4
5
6
7
8
9
10
11
|
# File 'lib/abyme/model.rb', line 4
def abymize(association, permit: nil, reject: nil, class_name: nil, **options)
default_options = {reject_if: :all_blank, allow_destroy: true}
nested_attributes_options = default_options.merge(options)
accepts_nested_attributes_for association, nested_attributes_options
save_destroy_option(association, nested_attributes_options[:allow_destroy])
Abyme::Model.permit_attributes(name, association, permit || reject, permit.present?, class_name) if permit.present? || reject.present?
end
|