Forum: Ruby on Rails is 'type' a reserved word?

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.
jko170 (Guest)
on 2007-04-05 12:46
(Received via mailing list)
I'd like to my a 'type' column in my database. Will this create a
problem? thanks.
Jordan E. (Guest)
on 2007-04-05 12:56
(Received via mailing list)
> I'd like to my a 'type' column in my database. Will this create a
> problem? thanks.

Yes, it's used for STI. See here:
http://api.rubyonrails.org/classes/ActiveRecord/Base.html
I think you can change it, but not sure how.

HTH,
Jordan
Marston A. (Guest)
on 2007-04-05 13:24
(Received via mailing list)
Yup it is.  I've run into this quite a bit, I just name my columns
"type_of" now.
(Guest)
on 2007-04-05 17:23
(Received via mailing list)
Not to be a curmudgeon, but it really is easy to just try using "type"
as a column name and see if you run into a problem. It probably takes
less time too.
This topic is locked and can not be replied to.