9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/uuid_associations/active_record/nested_attributes_method_definitions.rb', line 9
def accepts_nested_attributes_for(*attr_names)
options = attr_names.
create_missing_uuids = { create_missing_uuids: options.delete(:create_missing_uuids) { false } }
original_payload = super(
*(attr_names + [options])
)
attr_names.each do |association_name|
nested_attributes_options = self.nested_attributes_options.dup
nested_attributes_options[association_name.to_sym] = nested_attributes_options[association_name.to_sym].merge(create_missing_uuids)
self.nested_attributes_options = nested_attributes_options
end
original_payload
end
|