Methods ending with an equal sign? (Ruby basics)

A method defined on a model that ends with = is an assignment method, so when ActiveRecord is trying to save an attribute to this model, you can define a custom action to perform the save. Useful, for example, when passing a hash to this model for some list of things that is not part of active record.

Leave a Reply

OR LOG IN WITH




Your email address will not be published. Required fields are marked *