Forum: Ruby on Rails STI 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.
nico (Guest)
on 2009-05-23 15:02
(Received via mailing list)
Hi,

I'm having trouble with some STI Classes in a test.

When I create a new Class of an STI derived base class
the type column is not set.

If I do

object = DerivedClass.create!(params)

then object[:type] == nil for some reason.

Any ideas why this is so? I assumed rails takes
care of setting the type column in STI (that's what I read).

Nico
nico (Guest)
on 2009-05-25 11:03
(Received via mailing list)
Ooops, solved it! Was a problem with a migration...
This topic is locked and can not be replied to.