1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Dont check for class equaity when merging relations

This commit is contained in:
Pratik Naik 2010-01-18 04:28:21 +05:30
parent 88de6b2de2
commit e1d507c7fb
2 changed files with 0 additions and 8 deletions

View file

@ -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

View file

@ -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