Forum: Ruby on Rails bug? : STI and :include => fk and class_name MUST be specifi

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.
Alain R. (Guest)
on 2006-01-10 18:56
(Received via mailing list)
I suspect this is a bug. Or a limitation.

When you include a STI class in a 'find' :
        @results = Result.find :all, :include => :event

, you are forced to specify the fk and the class name :
         belongs_to  :event , :class_name => "Event", :foreign_key =>

Full code:

class Event < Foo   ### <<---- S.T.I.
     has_many    :results

class Result < ActiveRecord::Base
     belongs_to  :event ,
             :class_name => "Event", :foreign_key => "event_id"  ###



Q: If this is a unknown bug, do I have to report it officially?
This topic is locked and can not be replied to.