diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2009-10-14 19:32:09 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2009-10-14 19:32:09 -0700 |
commit | c09a5ffea7780a0f940f3f963c892f0ae1316802 (patch) | |
tree | e5908025ddccf62dc183f6e6ced4d87bf265b28a /activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb | |
parent | a9f9ae385e2145b7f0d1ae43a7b66ed280b220b9 (diff) | |
parent | 6eee1dd62c85e23d84f16e8f300d8aba77bd5c64 (diff) | |
download | rails-c09a5ffea7780a0f940f3f963c892f0ae1316802.tar.gz rails-c09a5ffea7780a0f940f3f963c892f0ae1316802.tar.bz2 rails-c09a5ffea7780a0f940f3f963c892f0ae1316802.zip |
Merge branch 'arel'
Diffstat (limited to 'activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb')
-rw-r--r-- | activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb b/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb index 11a159686e..1bce45865f 100644 --- a/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb +++ b/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb @@ -732,7 +732,7 @@ class HasAndBelongsToManyAssociationsTest < ActiveRecord::TestCase assert_equal [projects(:active_record), projects(:action_controller)].map(&:id).sort, developer.project_ids.sort end - def test_select_limited_ids_list + def test_select_limited_ids_array # Set timestamps Developer.transaction do Developer.find(:all, :order => 'id').each_with_index do |record, i| @@ -742,9 +742,9 @@ class HasAndBelongsToManyAssociationsTest < ActiveRecord::TestCase join_base = ActiveRecord::Associations::ClassMethods::JoinDependency::JoinBase.new(Project) join_dep = ActiveRecord::Associations::ClassMethods::JoinDependency.new(join_base, :developers, nil) - projects = Project.send(:select_limited_ids_list, {:order => 'developers.created_at'}, join_dep) + projects = Project.send(:select_limited_ids_array, {:order => 'developers.created_at'}, join_dep) assert !projects.include?("'"), projects - assert_equal %w(1 2), projects.scan(/\d/).sort + assert_equal ["1", "2"], projects.sort end def test_scoped_find_on_through_association_doesnt_return_read_only_records @@ -770,7 +770,7 @@ class HasAndBelongsToManyAssociationsTest < ActiveRecord::TestCase assert_equal developer, project.developers.find(:first) assert_equal project, developer.projects.find(:first) end - + def test_self_referential_habtm_without_foreign_key_set_should_raise_exception assert_raise(ActiveRecord::HasAndBelongsToManyAssociationForeignKeyNeeded) { Member.class_eval do |