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.
1df9fc8ddf084661265bbae74a8d0b43?d=identicon&s=25 jko170 (Guest)
on 2007-04-05 10:46
(Received via mailing list)
I'd like to my a 'type' column in my database. Will this create a
problem? thanks.
188a96403bfb1b3781ab95fc1bc92241?d=identicon&s=25 Jordan Elver (jordelver)
on 2007-04-05 10: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
153107d9ef8352ea7f787d2090d81666?d=identicon&s=25 Marston A. (Guest)
on 2007-04-05 11:24
(Received via mailing list)
Yup it is.  I've run into this quite a bit, I just name my columns
"type_of" now.
B1664e3af08e4a995b5b37c5a523abeb?d=identicon&s=25 nonrecursive@gmail.com (Guest)
on 2007-04-05 15: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.