I\'m trying to overwrite a getter method for an ActiveRecord model. I have an attribute called name in the model Category, and I\'d like to be able
name
Category
The Rails Style Guide recommends using self[:attr] over read_attribute(:attr).
self[:attr]
read_attribute(:attr)
You can use it like this:
def name name_trans || self[:name] end