module RailsAdmin::Adapters::Mongoid::Extension::ClassMethods
Public Instance Methods
accepts_nested_attributes_for_with_rails_admin(*args)
click to toggle source
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
# File lib/rails_admin/adapters/mongoid/extension.rb, line 37 def accepts_nested_attributes_for_with_rails_admin(*args) options = args.extract_options! args.each do |arg| nested_attributes_options[arg.to_sym] = options.reverse_merge(allow_destroy: false, update_only: false) end args << options accepts_nested_attributes_for_without_rails_admin(*args) end