diff options
author | Emilio Tagua <miloops@gmail.com> | 2009-08-07 13:16:34 -0300 |
---|---|---|
committer | Emilio Tagua <miloops@gmail.com> | 2009-08-07 13:16:34 -0300 |
commit | 945ef58533e93d0abbf7ccdb3768e8654cbe6370 (patch) | |
tree | e05178baf5cf65455cc7cc621fa511f52040f276 /activerecord/test/cases/associations | |
parent | 4e86602e114223adee4d6733695434db5c1bd824 (diff) | |
download | rails-945ef58533e93d0abbf7ccdb3768e8654cbe6370.tar.gz rails-945ef58533e93d0abbf7ccdb3768e8654cbe6370.tar.bz2 rails-945ef58533e93d0abbf7ccdb3768e8654cbe6370.zip |
More work on removing plain SQL from associations and use ARel instead.
Diffstat (limited to 'activerecord/test/cases/associations')
-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 14b96caaae..9c915ab010 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 @@ -730,7 +730,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| @@ -740,9 +740,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 @@ -768,7 +768,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 |