I have a model for one of my database tables. I want to override the column name for that particular table. How would I achieve it.
For example, let my table be call
You can override the col_a method. Use the read_attribute method to read the value in database. Something like this:
col_a
def col_a if self.read_attribute(:col_a).to_s.end_with?('0') 0 else self.read_attribute(:col_a) end end