Active record attributes

The attribute method can be used to define virtual columns for your model where you can store computed values from queries, or it can even override behavior for database-backed columns.

source

View on Github