Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Dont check for class equaity when merging relations

  • Loading branch information...
commit e1d507c7fb541d29d57d152f40e3a539e70781d0 1 parent 88de6b2
Pratik lifo authored
4 activerecord/lib/active_record/relation/spawn_methods.rb
View
@@ -15,10 +15,6 @@ def spawn(arel_table = self.table)
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
4 activerecord/test/cases/relations_test.rb
View
@@ -420,10 +420,6 @@ def test_relation_merging_with_preload
end
end
- def test_invalid_merge
- assert_raises(ArgumentError) { Post.scoped & Developer.scoped }
- end
-
def test_count
posts = Post.scoped
Please sign in to comment.
Something went wrong with that request. Please try again.