search for: acts_as_readonly_if

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

2009 Mar 02
0
Implementing conditional read-only attributes of ActiveRecord objects
...") if attr.changed? end end only that "changed?" in this context would probably not work since the object in question would not be "changed", but newly created from a params Array. But also IMHO, this concept should IMHO be extracted into a plugin. Something like acts_as_readonly_if :firstname, :lastname, :gender_id, :birthdate, :if => :passport_verified? which would define is_readonly? and extend the validations. My questions are - - does this make any sense? - has anything like this perhaps already been done (and if so, where)? - would anybody like to help? ;) Maybe so...