Module: RailsAdmin::Adapters::Mongoid::NestedAttributesExtension
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/rails_admin/adapters/mongoid/extension.rb
Instance Method Summary collapse
-
#accepts_nested_attributes_for_with_rails_admin(*args) ⇒ Object
Mongoid accepts_nested_attributes_for does not store options in accessible scope, so we intercept the call and store it in instance variable which can be accessed from outside.
Instance Method Details
#accepts_nested_attributes_for_with_rails_admin(*args) ⇒ Object
Mongoid accepts_nested_attributes_for does not store options in accessible scope, so we intercept the call and store it in instance variable which can be accessed from outside
36 37 38 39 40 41 42 43 44 |
# File 'lib/rails_admin/adapters/mongoid/extension.rb', line 36 def accepts_nested_attributes_for_with_rails_admin(*args) @nested_attributes_options ||= {} = args. args.each do |arg| @nested_attributes_options[arg.to_sym] = .reverse_merge(:allow_destroy=>false, :update_only=>false) end args << accepts_nested_attributes_for_without_rails_admin(*args) end |