Module: ActiveRecord::Scoping::ClassMethods

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

Instance Method Summary collapse

Instance Method Details

#current_scope(skip_inherited_scope = false) ⇒ Object

:nodoc:



15
16
17
# File 'activerecord/lib/active_record/scoping.rb', line 15

def current_scope(skip_inherited_scope = false) # :nodoc:
  ScopeRegistry.value_for(:current_scope, self, skip_inherited_scope)
end

#current_scope=(scope) ⇒ Object

:nodoc:



19
20
21
# File 'activerecord/lib/active_record/scoping.rb', line 19

def current_scope=(scope) #:nodoc:
  ScopeRegistry.set_value_for(:current_scope, self, scope)
end

#scope_attributesObject

Collects attributes from scopes that should be applied when creating an AR instance for the particular class this is called on.



25
26
27
# File 'activerecord/lib/active_record/scoping.rb', line 25

def scope_attributes # :nodoc:
  all.scope_for_create
end

#scope_attributes?Boolean

Are there attributes associated with this scope?

Returns:

  • (Boolean)


30
31
32
# File 'activerecord/lib/active_record/scoping.rb', line 30

def scope_attributes? # :nodoc:
  current_scope
end