instance method
default_scoped
Ruby on Rails 7.2.3
Since v6.0.6Signature
default_scoped(scope = relation, all_queries: nil)
Returns a scope for the model with default scopes.
Parameters
-
scopeopt = relation -
all_querieskey = nil
Source
# File activerecord/lib/active_record/scoping/named.rb, line 45
def default_scoped(scope = relation, all_queries: nil)
build_default_scope(scope, all_queries: all_queries) || scope
end
Defined in activerecord/lib/active_record/scoping/named.rb line 45
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::Scoping::Named::ClassMethods