A project I’m working on required a score to be calculated on an ActiveRecord model, and stored in the database. The User#calculate_score method calculates the score: In ActiveRecord models, a convention is that methods that update the database should have a bang, or an exclamation point appended to their names. To add a function that stores the score, we add User#calculate_score!: