diff options
author | Mehmet Emin İNAÇ <mehmetemininac@gmail.com> | 2015-04-15 21:00:09 +0300 |
---|---|---|
committer | Mehmet Emin İNAÇ <mehmetemininac@gmail.com> | 2015-04-15 23:02:32 +0300 |
commit | 929fcd26179f2b589d52f9515cbd349f1197ece9 (patch) | |
tree | 34f3c9d9545c69a8b2ca00818bff845ad116de9a /activerecord/test/cases/scoping | |
parent | 4825042a1c8d5527a7da468937d03f7e07362ce1 (diff) | |
download | rails-929fcd26179f2b589d52f9515cbd349f1197ece9.tar.gz rails-929fcd26179f2b589d52f9515cbd349f1197ece9.tar.bz2 rails-929fcd26179f2b589d52f9515cbd349f1197ece9.zip |
Prevent duplicating `where` clauses when model is extended from an abstract class
Fixes #19528
fix for mysql2 test
better test
Diffstat (limited to 'activerecord/test/cases/scoping')
-rw-r--r-- | activerecord/test/cases/scoping/default_scoping_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/test/cases/scoping/default_scoping_test.rb b/activerecord/test/cases/scoping/default_scoping_test.rb index 4137b20c4a..32264f692a 100644 --- a/activerecord/test/cases/scoping/default_scoping_test.rb +++ b/activerecord/test/cases/scoping/default_scoping_test.rb @@ -3,6 +3,7 @@ require 'models/post' require 'models/comment' require 'models/developer' require 'models/computer' +require 'models/vehicle' class DefaultScopingTest < ActiveRecord::TestCase fixtures :developers, :posts, :comments @@ -441,4 +442,9 @@ class DefaultScopingTest < ActiveRecord::TestCase assert_equal 1, scope.where_clause.ast.children.length assert_equal Developer.where(name: "David"), scope end + + def test_with_abstract_class_where_clause_should_not_be_duplicated + scope = Bus.all + assert_equal scope.where_clause.ast.children.length, 1 + end end |