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:
parent
88de6b2de2
commit
e1d507c7fb
2 changed files with 0 additions and 8 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue