Method: ActiveRecord::Scoping::Named::ClassMethods#scope_for_association

Defined in:
activerecord/lib/active_record/scoping/named.rb

#scope_for_association(scope = relation) ⇒ Object

:nodoc:



36
37
38
39
40
41
42
# File 'activerecord/lib/active_record/scoping/named.rb', line 36

def scope_for_association(scope = relation) # :nodoc:
  if current_scope&.empty_scope?
    scope
  else
    default_scoped(scope)
  end
end