Module: Dynabute::NestedAttributes::API

Extended by:
ActiveSupport::Concern
Defined in:
lib/dynabute/nested_attributes.rb

Instance Method Summary collapse

Instance Method Details

#dynabute_values_attributes=(attributes_list) ⇒ Object

  • value: value

  • (field_id || name): to identify the field

  • id?: – has_many: to determine create or update – has_one: if the corresponding value record exists, will be added either way



90
91
92
93
94
95
96
97
# File 'lib/dynabute/nested_attributes.rb', line 90

def dynabute_values_attributes=(attributes_list)
  Builder.new(attributes_list, self).build_assignable_attributes do |attributes|
    attributes.each do |relation, params|
      # this is a private method so can't call from inside Builder
      assign_nested_attributes_for_collection_association(relation, params)
    end
  end
end