RailsCasts Pro episodes are now free!

Learn more or hide this

Evan Marell's Profile

GitHub User: Evan-M

Comments by Evan Marell

Avatar

I believe the ActiveModel::MassAssignmentSecurity module was changed for the release of Rails 3.1.

Now you can do this (in a non-ActiveRecord class):

ruby
include ActiveModel::MassAssignmentSecurity

attr_accessible :first_name, :last_name
attr_accessible :first_name, :last_name, :plan_id, :as => :admin

http://api.rubyonrails.org/classes/ActiveModel/MassAssignmentSecurity.html
http://api.rubyonrails.org/classes/ActiveModel/MassAssignmentSecurity/ClassMethods.html