Hi,
I''m trying to use :through and STI using the trunk version of Rails,
but
I get the following error see bottom of this msg[1]
here are my classes.
class Player < ActiveRecord::Base
end
class Ladder < ActiveRecord::Base
has_many :subscriptions
has_many :players, :through => :subscriptions
end
class SingleLadder < Ladder
end
class Subscription < ActiveRecord::Base
belongs_to :players
belongs_to :ladders
end
Any ideas??
Jeroen
[1]
>> Ladder.find(:first).players
NameError:
./script/../config/../config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:89:in
`const_missing'': uninitialized constant Players
from
./script/../config/../config/../vendor/rails/activerecord/lib/active_record/base.rb:1197:in
`instance_eval''
from
./script/../config/../config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:120:in
`const_missing''
from
./script/../config/../config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:122:in
`send''
from
./script/../config/../config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:122:in
`const_missing''
from (eval):1:in `instance_eval''
from
./script/../config/../config/../vendor/rails/activerecord/lib/active_record/base.rb:1197:in
`instance_eval''
from
./script/../config/../config/../vendor/rails/activerecord/lib/active_record/base.rb:1197:in
`compute_type''
from
./script/../config/../config/../vendor/rails/activerecord/lib/active_record/reflection.rb:112:in
`send''
from
./script/../config/../config/../vendor/rails/activerecord/lib/active_record/reflection.rb:112:in
`klass''
from
./script/../config/../config/../vendor/rails/activerecord/lib/active_record/associations/has_many_through_association.rb:54:in
`find_target''
from
./script/../config/../config/../vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:116:in
`load_target''
from
./script/../config/../config/../vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:109:in
`method_missing''
from
./script/../config/../config/../vendor/rails/activerecord/lib/active_record/associations/has_many_through_association.rb:47:in
`method_missing''
from
/Applications/Locomotive/Bundles/rails-1.0.0-max.bundle/Contents/Resources/ports/lib/ruby/1.8/irb.rb:296:in
`output_value''
from
/Applications/Locomotive/Bundles/rails-1.0.0-max.bundle/Contents/Resources/ports/lib/ruby/1.8/irb.rb:149:in
`eval_input''
from
/Applications/Locomotive/Bundles/rails-1.0.0-max.bundle/Contents/Resources/ports/lib/ruby/1.8/irb.rb:145:in
`signal_status''
from
/Applications/Locomotive/Bundles/rails-1.0.0-max.bundle/Contents/Resources/ports/lib/ruby/1.8/irb.rb:145:in
`eval_input''
from
/Applications/Locomotive/Bundles/rails-1.0.0-max.bundle/Contents/Resources/ports/lib/ruby/1.8/irb.rb:144:in
`each_top_level_statement''
from
/Applications/Locomotive/Bundles/rails-1.0.0-max.bundle/Contents/Resources/ports/lib/ruby/1.8/irb.rb:144:in
`eval_input''
from
/Applications/Locomotive/Bundles/rails-1.0.0-max.bundle/Contents/Resources/ports/lib/ruby/1.8/irb.rb:70:in
`start''
from
/Applications/Locomotive/Bundles/rails-1.0.0-max.bundle/Contents/Resources/ports/lib/ruby/1.8/irb.rb:69:in
`catch''
from
/Applications/Locomotive/Bundles/rails-1.0.0-max.bundle/Contents/Resources/ports/lib/ruby/1.8/irb.rb:69:in
`start''
f