Module: Cashboard::Behaviors::ListsLineItems

Included in:
Estimate, Project
Defined in:
lib/cashboard/behaviors/lists_line_items.rb

Overview

Standard interface to list associated LineItems for Projects and Estimates

Instance Method Summary collapse

Instance Method Details

#custom_itemsObject

LineItems of type ‘custom’



22
23
24
# File 'lib/cashboard/behaviors/lists_line_items.rb', line 22

def custom_items
  self.filter_line_items_by :custom
end

#line_items(options = {}) ⇒ Object

Returns all associated LineItems regardless of type



5
6
7
8
9
# File 'lib/cashboard/behaviors/lists_line_items.rb', line 5

def line_items(options={})
  self.class.get_collection(
    self.links[:line_items], Cashboard::LineItem, options
  )
end

#productsObject

LineItems of type ‘product’



17
18
19
# File 'lib/cashboard/behaviors/lists_line_items.rb', line 17

def products
  self.filter_line_items_by :product
end

#tasksObject

LineItems of type ‘task’



12
13
14
# File 'lib/cashboard/behaviors/lists_line_items.rb', line 12

def tasks
  self.filter_line_items_by :task
end