Forum: Ruby on Rails STI Problem

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
nico (Guest)
on 2009-05-23 15:02
(Received via mailing list)

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 (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.