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/lib | |
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/lib')
-rw-r--r-- | activerecord/lib/active_record/scoping/default.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/scoping/default.rb b/activerecord/lib/active_record/scoping/default.rb index 3590b8846e..a1adf8e3ee 100644 --- a/activerecord/lib/active_record/scoping/default.rb +++ b/activerecord/lib/active_record/scoping/default.rb @@ -100,6 +100,7 @@ module ActiveRecord end def build_default_scope(base_rel = relation) # :nodoc: + return if abstract_class? if !Base.is_a?(method(:default_scope).owner) # The user has defined their own default scope method, so call that evaluate_default_scope { default_scope } |