Forum: Ruby on Rails activerecord: column named 'type' silently ignore (pgsql)

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.
Sd S. (Guest)
on 2006-02-08 15:16
Hi,

I've been scraching my head on that.

If a column is named 'type' then nothing appear in
this column in postgresql!

Just changing the name to 'typ' instead of 'type'
fix the problem.



I'm using the latest: activerecord (1.13.2)


I think I'm at the rignt place to post this!
Sorry if I'm on the wrong list or if this is
a well known 'feature' :)



Sylvain.
Pat M. (Guest)
on 2006-02-08 15:20
(Received via mailing list)
'type' is the column name used in single table inheritance, so you
can't use it as a basic column name.  Tripped me up a bit the first
time around as well.

Pat
sayoyo S. (Guest)
on 2006-02-08 16:12
(Received via mailing list)
Hi,

There is some predefined tables and classes used in
Ruby-Rails, I have once a table "search" and rails
have already defined that table. so it has never my
"table" which has been used. I think it may be the
same case...

Saiho


--- sd sd <removed_email_address@domain.invalid> wrote:

>
> Sylvain.
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Rails mailing list
> removed_email_address@domain.invalid
> http://lists.rubyonrails.org/mailman/listinfo/rails
>


If God really exists, I would like to
know what the dinosaurs have done to
deserve their extinction.

Water is unknown to fishes,
until they discover air.

http://www.geocities.com/sayoyo/

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Maria Gutierrez (Guest)
on 2006-02-08 16:18
(Received via mailing list)
I had the same problem as you. I had to change my column to 'category'
instead.
When you do <model>.type you get the class type. So I guess that this
is why it doesn't work. The name of your column is clashing with the
Object variable type.
This topic is locked and can not be replied to.