ActiveRecord attribute calls interception
I need to intercept attribute calls and add some additional info to them.
class ActiveRecord::Base def self.multilingual_field(fieldname) module_eval <<-end_eval def #{fieldname} send("#{fieldname}_\#{Locale.language.short_name}") end def #{fieldname}=(value) send("#{fieldname}_\#{Locale.language.short_name}=",value) end end_eval end end