I have a database column storing a duration value as a number of
seconds, but I’d like users to be able to see it and edit it as a time
value. I am trying to override the default accessor/mutator for the
attribute and do the conversions there, using something that looks
like:
def duration
Time.at(self[:duration].to_i).getutc
end
def duration=(value)
self[:duration] = value.to_i
end
Everything seems OK, but when I go to save the record, I get the
following:
ActiveRecord::MultiparameterAssignmentErrors in
AdminController#update
1 error(s) on assignment of multiparameter attributes
What am I missing?