Railroad problem with :through?

I have the following model layout:

class List < ActiveRecord::Base
has_many :subscribers, :through => :list_subscribers
has_many :list_subscribers
end

class Subscriber < ActiveRecord::Base
has_many :lists
has_many :lists, :through => :list_subscribers
end

class ListSubscriber< ActiveRecord::Base
belongs_to :list
belongs_to :subscriber

validates_uniqueness_of :subscriber_id, :scope => :list_id
end

and get the following error:

railroad -i -l -a -m -M | dot -Tpng | sed
's/font-size:14.00/font-size:12.00/g' > doc/models.png
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/whiny_nil.rb:52:in
`method_missing': undefined method `klass' for nil:NilClass
(NoMethodError)
from
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/reflection.rb:320:in
`source_reflection'
from
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/reflection.rb:320:in
`collect'
from
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/reflection.rb:320:in
`source_reflection'
from
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/reflection.rb:381:in
`derive_class_name'
from
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/reflection.rb:112:in
`class_name'
from
/home/kaitest/.gem/ruby/1.8/gems/dmattes-railroad_xing-0.5.4/lib/railroad/ar_model.rb:85:in
`process_association'
from
/home/kaitest/.gem/ruby/1.8/gems/dmattes-railroad_xing-0.5.4/lib/railroad/ar_model.rb:65:in
`edges'
from
/home/kaitest/.gem/ruby/1.8/gems/dmattes-railroad_xing-0.5.4/lib/railroad/ar_model.rb:64:in
`each'
from
/home/kaitest/.gem/ruby/1.8/gems/dmattes-railroad_xing-0.5.4/lib/railroad/ar_model.rb:64:in
`edges'
from
/home/kaitest/.gem/ruby/1.8/gems/dmattes-railroad_xing-0.5.4/lib/railroad/models_diagram.rb:69:in
`process_class'
from
/home/kaitest/.gem/ruby/1.8/gems/dmattes-railroad_xing-0.5.4/lib/railroad/models_diagram.rb:29:in
`generate'
from
/home/kaitest/.gem/ruby/1.8/gems/dmattes-railroad_xing-0.5.4/lib/railroad/models_diagram.rb:28:in
`each'
from
/home/kaitest/.gem/ruby/1.8/gems/dmattes-railroad_xing-0.5.4/lib/railroad/models_diagram.rb:28:in
`generate'
from
/home/kaitest/.gem/ruby/1.8/gems/dmattes-railroad_xing-0.5.4/bin/railroad:47
from /home/kaitest/.gem/ruby/1.8/bin/railroad:19:in `load'
from /home/kaitest/.gem/ruby/1.8/bin/railroad:19

Any help much appreciated.

Sem Ptiri wrote:

Is this a typo, or your problem source?

class Subscriber < ActiveRecord::Base
has_many :lists
has_many :lists, :through => :list_subscribers
end

class Subscriber < ActiveRecord::Base
  has_many :list_subscribers
  has_many :lists, :through => :list_subscribers
end

Ar Chron wrote:

Sem Ptiri wrote:

Is this a typo, or your problem source?

class Subscriber < ActiveRecord::Base
has_many :lists
has_many :lists, :through => :list_subscribers
end

class Subscriber < ActiveRecord::Base
  has_many :list_subscribers
  has_many :lists, :through => :list_subscribers
end

My problem source.

Thank you.