Forum: Ruby on Rails Table with a field name 'type' problem.

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.
exwhyz (Guest)
on 2006-03-15 05:49
I have a table with a fieldname called 'type' which does not present
itself on the CRUD screens. However if I rename it to 'some_type' it
works just fine. Any ideas? Here is my configuration:

Ruby version 1.8.2 (i386-mswin32)
RubyGems version 0.8.10
Rails version 1.0.0
Active Record version 1.13.2
Action Pack version 1.11.2
Action Web Service version 1.0.0
Action Mailer version 1.1.5
Active Support version 1.2.5
Application root C:/Documents and Settings/blip/selars
Environment development
Database adapter mysql
Peter M. (Guest)
on 2006-03-15 06:06
(Received via mailing list)
My Ruby books says "type" is an instance method of the Object class.
It is a depricated synonym for the prefered "class" method.

-Peter
Ray B. (Guest)
on 2006-03-15 08:03
(Received via mailing list)
exwhyz wrote:
> I have a table with a fieldname called 'type' which does not present
> itself on the CRUD screens. However if I rename it to 'some_type' it
> works just fine. Any ideas?

type as a field name has a special meaning in ActiveRecord. It is used
in single table inheritance to specify the type of the object in that
row of the database. According to the docs, you can change this by
overwriting Base.inheritance_column, although I haven't tried myself.


Ray
This topic is locked and can not be replied to.