By accident I had Rails-3.1.1 installed by bundler. However, when I
discovered this mishap during my feature run I encountered this error
in many places:

wrong number of arguments (1 for 0) (ArgumentError)
/home/byrnejb/.rvm/gems/ruby-1.8.7-p352/gems/activemodel-3.1.1/
lib/active_model/mass_assignment_security.rb:209:in
`mass_assignment_authorizer'
/home/byrnejb/.rvm/gems/ruby-1.8.7-p352/gems/activemodel-3.1.1/
lib/active_model/mass_assignment_security.rb:209:in
`sanitize_for_mass_assignment'
/home/byrnejb/.rvm/gems/ruby-1.8.7-p352/gems/activerecord-3.1.1/
lib/active_record/base.rb:1744:in `assign_attributes'
/home/byrnejb/.rvm/gems/ruby-1.8.7-p352/gems/activerecord-3.1.1/
lib/active_record/base.rb:1567:in `initialize'
/home/byrnejb/.rvm/gems/ruby-1.8.7-p352/gems/activerecord-3.1.1/
lib/active_record/reflection.rb:190:in `new'


Everything was working on Friday last with Rails-3.0.9 and no changes
to the code or the features have been made. I am therefore somewhat
curious as to what might be causing this. I previously had mass
assignment turned off in an initializer:

$ cat config/initializers/attr_accessible_nil.rb
#ActiveRecord::Base.send(:attr_accessible, nil)

So, I am wondering if this might be the cause of the problem. Note
that I have no intention of moving to Rails-3.1.1 at the moment. I am
just curious as to what would be causing this error.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Search Discussions

  • Byrnejb at Nov 7, 2011 at 9:28 pm
    I found my problem is a library I wrote to turn off mass assignment .
    In it I am calling this:

    # override AR method
    def mass_assignment_authorizer
    if accessible == :all
    self.class.protected_attributes
    else
    super + ( accessible || [] )
    end
    end

    Mass_assignment_authorizer has a different signature in Rails 3.1 thus
    the problem. By my way of thinking the signature change means that we
    should be talking of Rails-4.0.1 instead of Rails-3.1.1. But, then
    again, given what has happened to Firefox perhaps not.

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
  • Frederick Cheung at Nov 10, 2011 at 3:08 pm

    On Nov 7, 9:27 pm, byrnejb wrote:
    I found my problem is a library I wrote to turn off mass assignment .
    In it I am calling this:

    # override AR method
    def mass_assignment_authorizer
    if accessible == :all
    self.class.protected_attributes
    else
    super + ( accessible || [] )
    end
    end

    Mass_assignment_authorizer has a different signature in Rails 3.1 thus
    the problem.  By my way of thinking the signature change means that we
    should be talking of Rails-4.0.1 instead of Rails-3.1.1. But, then
    again, given what has happened to Firefox perhaps not.
    You can't expect every single internal rails method not to change
    between rails versions (although public methods should certainly not
    change signature like that).
    One of the things 3.0 was supposed to bring was greater clarity about
    what bits of the internals could be depended upon in this manner and
    which couldn't. Part of that involved breaking up action controller
    into more reusable components, but I'm not sure where things got to
    with active record.

    Fred

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedNov 7, '11 at 8:41p
activeNov 10, '11 at 3:08p
posts3
users2
websiterubyonrails.org
irc#RubyOnRails

2 users in discussion

Byrnejb: 2 posts Frederick Cheung: 1 post

People

Translate

site design / logo © 2022 Grokbase