Forum: Ruby on Rails ActiveRecord updating an attribute by adding a value

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Ee0293412faca21e4ebf3326ed9d5f8c?d=identicon&s=25 Kad Kerforn (kadoudal)
on 2007-02-14 18:24
I have an attribute :notation in my model
and I would like to update it by adding an amount ..
should I read first the existing value from the DB, add the amount to it
and save it back or
is it possible to do it in one update by defing a method in the model ?


This topic is locked and can not be replied to.