This question has probably been asked before, but I was wondering if there was a mechanism that allows me to to the opposite of :before_save?
eg
class MyObject < ActiveRecord::Base
before_return :split_tags
def split_tags
self.tags = self.tags.split(',')
end
end
I am saving tags of MyObject into a database, separated by commas. When asking for the MyObject back from the database, I’d like the tags to become an array.
Just change the getter: