block by christophermanning 9b1220293b70fc71968b

Rails ActiveRecord 4.1.2.rc2 Namespaced HABTM Regression

➜  ~  ruby habtm.rb
Active Record 4.1.1
-- create_table(:articles, {:force=>true})
   -> 0.3158s
-- create_table(:publisher_magazines, {:force=>true})
   -> 0.0005s
-- create_table(:articles_publisher_magazines, {:force=>true})
   -> 0.0005s
#<ActiveRecord::Associations::CollectionProxy [#<Article id: 1>]>

➜  ~  ruby habtm.rb
Active Record 4.1.2.rc2
-- create_table(:articles, {:force=>true})
   -> 0.3163s
-- create_table(:publisher_magazines, {:force=>true})
   -> 0.0005s
-- create_table(:articles_publisher_magazines, {:force=>true})
   -> 0.0005s
/home/cmanning/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/activesupport-4.1.2.rc2/lib/active_support/inflector/methods.rb:253:in `const_get': uninitialized constant Publisher::Article (NameError)
        from /home/cmanning/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/activesupport-4.1.2.rc2/lib/active_support/inflector/methods.rb:253:in `block in constantize'
        from /home/cmanning/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/activesupport-4.1.2.rc2/lib/active_support/inflector/methods.rb:236:in `each'
        from /home/cmanning/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/activesupport-4.1.2.rc2/lib/active_support/inflector/methods.rb:236:in `inject'
        from /home/cmanning/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/activesupport-4.1.2.rc2/lib/active_support/inflector/methods.rb:236:in `constantize'
        from /home/cmanning/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/activesupport-4.1.2.rc2/lib/active_support/core_ext/string/inflections.rb:66:in `constantize'
        from /home/cmanning/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/activerecord-4.1.2.rc2/lib/active_record/associations/builder/has_and_belongs_to_many.rb:18:in `klass'
        from /home/cmanning/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/activerecord-4.1.2.rc2/lib/active_record/associations/builder/has_and_belongs_to_many.rb:14:in `join_table'
        from /home/cmanning/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/activerecord-4.1.2.rc2/lib/active_record/associations/builder/has_and_belongs_to_many.rb:60:in `table_name'
        from /home/cmanning/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/activerecord-4.1.2.rc2/lib/active_record/core.rb:151:in `arel_table'
        from /home/cmanning/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/activerecord-4.1.2.rc2/lib/active_record/core.rb:167:in `relation'
        from /home/cmanning/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/activerecord-4.1.2.rc2/lib/active_record/scoping/named.rb:33:in `default_scoped'
        from /home/cmanning/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/activerecord-4.1.2.rc2/lib/active_record/scoping/named.rb:28:in `all'
        from /home/cmanning/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/activerecord-4.1.2.rc2/lib/active_record/associations/through_association.rb:17:in `block in target_scope'
        from /home/cmanning/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/activerecord-4.1.2.rc2/lib/active_record/associations/through_association.rb:16:in `each'
        from /home/cmanning/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/activerecord-4.1.2.rc2/lib/active_record/associations/through_association.rb:16:in `target_scope'
        from /home/cmanning/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/activerecord-4.1.2.rc2/lib/active_record/associations/association.rb:86:in `scope'
        from /home/cmanning/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/activerecord-4.1.2.rc2/lib/active_record/associations/collection_association.rb:404:in `scope'
        from /home/cmanning/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/activerecord-4.1.2.rc2/lib/active_record/associations/collection_proxy.rb:36:in `initialize'
        from /home/cmanning/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/activerecord-4.1.2.rc2/lib/active_record/relation/delegation.rb:106:in `new'
        from /home/cmanning/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/activerecord-4.1.2.rc2/lib/active_record/relation/delegation.rb:106:in `create'
        from /home/cmanning/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/activerecord-4.1.2.rc2/lib/active_record/associations/collection_association.rb:36:in `reader'
        from /home/cmanning/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/activerecord-4.1.2.rc2/lib/active_record/associations/builder/association.rb:110:in `articles'
        from habtm.rb:49:in `<main>'

habtm.rb