Skip to content

Instantly share code, notes, and snippets.

@nsanta
Created September 22, 2009 22:56
Show Gist options
  • Save nsanta/191524 to your computer and use it in GitHub Desktop.
Save nsanta/191524 to your computer and use it in GitHub Desktop.
accepts_nested_attributes_for :rfx_event_members ,
:reject_if => proc{|attributes| attributes[:role].blank? || attributes[:user_id].blank?}
def reject_new_record?(association_name, attributes)
has_delete_flag?(attributes) ||
self.class.reject_new_nested_attributes_procs[association_name].try(:call, attributes)
end
EL ERROR
wrong number of arguments (2 for 1)
RAILS_ROOT: /home/nicolas/projects/finario
Application Trace | Framework Trace | Full Trace
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/nested_attributes.rb:326:in `try'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/nested_attributes.rb:326:in `reject_new_record?'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/nested_attributes.rb:297:in `assign_nested_attributes_for_collection_association'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/nested_attributes.rb:293:in `each'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/nested_attributes.rb:293:in `assign_nested_attributes_for_collection_association'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/nested_attributes.rb:215:in `rfx_event_members_attributes='
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/base.rb:2744:in `send'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/base.rb:2744:in `attributes='
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/base.rb:2740:in `each'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/base.rb:2740:in `attributes='
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/base.rb:2632:in `update_attributes!'
/home/nicolas/projects/finario/app/controllers/account/requests_controller.rb:55:in `update'
/home/nicolas/projects/finario/app/controllers/account/requests_controller.rb:54:in `update'
/home/nicolas/projects/finario/app/controllers/application_controller.rb:164:in `check_security_transgression'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment