Forum: Ruby on Rails Activerecord attribute without db column

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Matias (Guest)
on 2006-06-11 20:10
(Received via mailing list)
Hi,

I've a model that is stored to the db, but just one of its atribbutes
doesn't have a corresponding column on the table (it is used just for a
calculation and still requires validation).

I've been succefull by doing what is explained in
http://rails.techno-weenie.net/tip/2005/11/19/vali...

But I get an error of a non-existent column for the attribute I don't
want
to store.

Any idea?

Thanks everybody
Tom M. (Guest)
on 2006-06-11 22:23
(Received via mailing list)
In the model, use:

   attr_accessor :attribute_name

--
-- Tom M.
This topic is locked and can not be replied to.