search for: attribute_accessible

Displaying 1 result from an estimated 1 matches for "attribute_accessible".

2008 Nov 01
0
Overloading #initialize in a model
I''m using WhinyProtectedAttributes: http://henrik.nyh.se/2007/10/whiny-protected-attributes Say I have this model: class Person < ActiveRecord::Base attribute_accessible :name end If I then create a Person with an invalid attribute, an exception is raised. For example: Person.new :name => ''Bob'', :asdf => ''asdf'' What I''d like to do is, in the Person model, modify the hash of attributes before they''re se...