mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Faster check for any default scope with all_queries
This commit is contained in:
parent
58b46e9440
commit
fde6da2164
1 changed files with 1 additions and 1 deletions
|
@ -57,7 +57,7 @@ module ActiveRecord
|
|||
# default_scopes for the model where +all_queries+ is true.
|
||||
def default_scopes?(all_queries: false)
|
||||
if all_queries
|
||||
self.default_scopes.map(&:all_queries).include?(true)
|
||||
self.default_scopes.any?(&:all_queries)
|
||||
else
|
||||
self.default_scopes.any?
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue