From 2091e5a65e2950689ad3242d67fdd7b15aa3411b Mon Sep 17 00:00:00 2001 From: Jon Leighton Date: Fri, 11 May 2012 23:43:18 +0100 Subject: [PATCH] Remove #=== quirk Makes it consistent with Relation. Can't see a use for this. --- .../lib/active_record/associations/collection_proxy.rb | 6 ------ .../has_and_belongs_to_many_associations_test.rb | 5 ----- .../test/cases/associations/has_many_associations_test.rb | 6 ------ 3 files changed, 17 deletions(-) diff --git a/activerecord/lib/active_record/associations/collection_proxy.rb b/activerecord/lib/active_record/associations/collection_proxy.rb index b3e46d3707..cf4cc98f38 100644 --- a/activerecord/lib/active_record/associations/collection_proxy.rb +++ b/activerecord/lib/active_record/associations/collection_proxy.rb @@ -79,12 +79,6 @@ module ActiveRecord load_target == other end - # Forwards === explicitly to the \target because the instance method - # removal above doesn't catch it. Loads the \target if needed. - def ===(other) - other === load_target - end - def to_ary load_target.dup end 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 cd581485d5..470f0c3fd3 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 @@ -123,11 +123,6 @@ class HasAndBelongsToManyAssociationsTest < ActiveRecord::TestCase assert active_record.developers.include?(david) end - def test_triple_equality - assert !(Array === Developer.find(1).projects) - assert Developer.find(1).projects === Array - end - def test_adding_single jamis = Developer.find(2) jamis.projects.reload # causing the collection to load diff --git a/activerecord/test/cases/associations/has_many_associations_test.rb b/activerecord/test/cases/associations/has_many_associations_test.rb index 47ad6a1ba7..13d8c68b33 100644 --- a/activerecord/test/cases/associations/has_many_associations_test.rb +++ b/activerecord/test/cases/associations/has_many_associations_test.rb @@ -326,12 +326,6 @@ class HasManyAssociationsTest < ActiveRecord::TestCase authors(:david).readonly_comments.each { |c| assert c.readonly? } end - def test_triple_equality - # sometimes tests on Oracle fail if ORDER BY is not provided therefore add always :order with :first - assert !(Array === Firm.scoped(:order => "id").first.clients) - assert Firm.scoped(:order => "id").first.clients === Array - end - def test_finding_default_orders assert_equal "Summit", Firm.scoped(:order => "id").first.clients.first.name end