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





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

Previous post With Passenger where does the console log (output from puts) go?
Next post Writing to the development log in Rails.