Felix M.
2006-Jan-31 02:41 UTC
[Rails] adding an attribute to a ActiveRecord::Base instance
I have an instance of ActiveRecord::Base called Site. Is it possible to add attributes to that class in code, like so class Site < ActiveRecord::Base belongs_to :user attr_accessor :type_site_boolop, :type_program_boolop, :books_only I don''t want those additional attributed in the DB. The problem is that given @site = Site.new @site.type_site_boolop = ''foo'' @site.attributes does not include type_site_boolop. Any ideas? Thanks again, I''m new too Rails and this forum has been most helpful already! Felix -- Posted via http://www.ruby-forum.com/.
Apparently Analagous Threads
- Session mgmt. bug - ActiveRecord & MemoryStore session store
- Custom Non-ActiveRecord Classes or not...
- controller instance methods available in rhtml?
- Paperclip attachment to AWS - ActiveRecord::AssociationTypeMismatch Going Nuts!
- Paperclip attachment to AWS - ActiveRecord::AssociationTypeMismatch