I suspect this is a bug. Or a limitation.
Problem:
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 =>
“event_id”
.
Full code:
class Event < Foo ### <<---- S.T.I.
has_many :results
end
class Result < ActiveRecord::Base
belongs_to :event ,
:class_name => “Event”, :foreign_key => “event_id” ###
MANDATORY ?!
acts_as_list
end
Alain
Q: If this is a unknown bug, do I have to report it officially?