I want to add to an existing model some attributes that need not be persisted, or even mapped to a database column. Is there a solution to specify such thing ?
Of course use good old ruby's attr_accessor. In your model:
attr_accessor
attr_accessor :foo, :bar
You'll be able to do:
object.foo = 'baz' object.foo #=> 'baz'
1.4m articles
1.4m replys
5 comments
57.0k users