Skip to content
This repository

accessible_attributes wrong number of arguments (1 for 0) with rails 3.2.5 #419

Closed
darragh opened this Issue June 01, 2012 · 5 comments

2 participants

Darragh Curran Michaël Rigart
Darragh Curran

I've narrowed it down to what goes on in accessible.rb (I guess :accessible_attributes can no longer be a simple class_attribute)

This prevents us upgrading an application using mongo_mapper to rails 3.2.5

.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/activesupport-3.2.5/lib/active_support/core_ext/class/attribute.rb:75:in `accessible_attributes': wrong number of arguments (1 for 0) (ArgumentError)
    from /Users/darragh/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/actionpack-3.2.5/lib/action_controller/metal/params_wrapper.rb:175:in `_set_wrapper_defaults'
    from /Users/darragh/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/actionpack-3.2.5/lib/action_controller/metal/params_wrapper.rb:133:in `inherited'
    from /Users/darragh/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/actionpack-3.2.5/lib/abstract_controller/railties/routes_helpers.rb:7:in `block (2 levels) in with'
    from /Users/darragh/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/actionpack-3.2.5/lib/action_controller/railties/paths.rb:7:in `block (2 levels) in with'

I don't have a patch right now.

Darragh Curran

That stack tace doesn't make things clear, but debugging through it, it happens when the first class including MongoMapper::Document is loaded by our app.

I believe a simple way to reproduce would be to create a new rails 3.2.5 app with mongo_mapper and a single model and try to boot it.

Michaël Rigart

hi darragh,

I can confirm this bug. The error is caused due to this commit:
rails/rails@bfb25f9

Looks like it's due to the new role parameter that has been added.

Michaël Rigart

could this be a naming conflict between the Accessible plugins class_attribute :accessible_attributes and the ActiveModel::MassAssignmentSecurity "accessible_attributes" class method?

Darragh Curran

4d35c67 seems to resolve this

Darragh Curran

Closing, since master now has a fix for this

Darragh Curran darragh closed this June 05, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.