Forum: Ruby on Rails Simple relations are failing

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.
Chris O. (Guest)
on 2009-01-03 02:03
Can anyone see why the league_organizers relation is failing.

class League < ActiveRecord::Base
  has_many :league_admins
  has_many :league_organizers, :through => :league_admins, :class_name
=> "User"

class LeagueAdmin < ActiveRecord::Base
  belongs_to :league
  belongs_to :user

I am getting the following error message:

ActiveRecord::HasManyThroughSourceAssociationNotFoundError: Could not
find the source association(s) :league_admins in model LeagueAdmin.  Try
'has_many :league_organizers, :through => :league_admins, :source =>
<name>'.  Is it one of :league or :user?
  from (irb):2

I tried adding the source option with and without the class_name but it
still fails.  As I mentioned it is a simple relation.  Has something
changed in the last while to cause this?

I am currently using Rails 2.2.2

Thanks for the help.
This topic is locked and can not be replied to.