Hi All,
Is it possible to have transient fields in a class that extends
ActiveRecord? If so how do I acheive it?
Thanks
Hi All,
Is it possible to have transient fields in a class that extends
ActiveRecord? If so how do I acheive it?
Thanks
I think you’re asking if it’s possible to add attributes to AR-
derived classes. Yes:
class Person < ActiveRecord::Base
attr_accessor :my_transient_field
end
p = Person.new
p.my_transient_field = 1
Duane J.
http://blog.inquirylabs.com/
Thanks Duane,
that was exactly what I was asking
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs