Module: ActiveRecord::Scoping::ClassMethods

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

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#current_scope(skip_inherited_scope = false) ⇒ Object



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

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

#current_scope=(scope) ⇒ Object



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

def current_scope=(scope)
  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.



17
18
19
# File 'activerecord/lib/active_record/scoping.rb', line 17

def scope_attributes
  all.scope_for_create
end

#scope_attributes?Boolean

Are there attributes associated with this scope?

Returns:

  • (Boolean)


22
23
24
# File 'activerecord/lib/active_record/scoping.rb', line 22

def scope_attributes?
  current_scope
end