I have some rails models which don't need any persistence, however I'd like rails to think the model actually has attributes x, y, z so when calling methods like to_json in the controller I get them included for free.
For example,
class ModelWithoutTableColumns << ActiveRecord::Base
def x
return "Custom stuff here"
end
There is no column x in the database for Table "ModelWithoutTable" (sorry for the slightly confusing name!)
Anyone have an idea how to tackle this one?