I have a model called Contact with the phone_number attribute. I have some customization methods like
def prefix=(num) self.phone_number[3..5] = num end
When I call @contact.update_attributes({:prefix => '510'}) , I get no errors and @contact gets the changes, but the changes do not get into the database. I tried using attr_accessible to specifically allow the use of these setter methods to no avail.
Is there a way to make update_attributes work for me? I am using Rails 2.3.8.
ruby-on-rails activerecord attributes
muirbot
source share