Class List
In: app/models/list.rb
Parent: ActiveRecord::Base

Methods

Public Instance methods

[Source]

    # File app/models/list.rb, line 17
17:   def existing_item_attributes=(item_attributes) 
18:     items.reject(&:new_record?).each do |item| 
19:       attributes = item_attributes[item.id.to_s] 
20:       if attributes 
21:         item.attributes = attributes 
22:       else 
23:         items.delete(item) 
24:       end 
25:     end 
26:   end

[Source]

    # File app/models/list.rb, line 11
11:   def new_item_attributes=(item_attributes) 
12:     item_attributes.each do |attributes| 
13:       items.build(attributes) 
14:     end 
15:   end

[Source]

    # File app/models/list.rb, line 28
28:   def remove_items
29:     items.each do |item|
30:       items.delete(item)
31:     end
32:   end

[Source]

    # File app/models/list.rb, line 34
34:   def save_items
35:     items.each do |item| 
36:       item.save(false) 
37:     end
38:   end

[Validate]