diff options
-rw-r--r-- | activerecord/lib/active_record/relation/spawn_methods.rb | 4 | ||||
-rw-r--r-- | activerecord/test/cases/relations_test.rb | 4 |
2 files changed, 0 insertions, 8 deletions
diff --git a/activerecord/lib/active_record/relation/spawn_methods.rb b/activerecord/lib/active_record/relation/spawn_methods.rb index 4ac9e50f5a..d5b13c6100 100644 --- a/activerecord/lib/active_record/relation/spawn_methods.rb +++ b/activerecord/lib/active_record/relation/spawn_methods.rb @@ -15,10 +15,6 @@ module ActiveRecord end def merge(r) - if r.klass != @klass - raise ArgumentError, "Cannot merge a #{r.klass.name}(##{r.klass.object_id}) relation with #{@klass.name}(##{@klass.object_id}) relation" - end - merged_relation = spawn return merged_relation unless r diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb index acf247d27b..e31d0ee3e8 100644 --- a/activerecord/test/cases/relations_test.rb +++ b/activerecord/test/cases/relations_test.rb @@ -420,10 +420,6 @@ class RelationTest < ActiveRecord::TestCase end end - def test_invalid_merge - assert_raises(ArgumentError) { Post.scoped & Developer.scoped } - end - def test_count posts = Post.scoped |