123456789_123456789_123456789_123456789_123456789_

Module: ActiveRecord::Scoping::ClassMethods

Do not use. This module is for internal use only.
Relationships & Source Files
Defined in: activerecord/lib/active_record/scoping.rb

Instance Attribute Summary

  • #scope_attributes readonly

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

  • #scope_attributes? ⇒ Boolean readonly

    Are there attributes associated with this scope?

Instance Method Summary

Instance Attribute Details

#scope_attributes (readonly)

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

[ GitHub ]

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

def scope_attributes
  all.scope_for_create
end

#scope_attributes?Boolean (readonly)

Are there attributes associated with this scope?

[ GitHub ]

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

def scope_attributes?
  current_scope
end

Instance Method Details

#current_scope(skip_inherited_scope = false)

[ GitHub ]

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

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

#current_scope=(scope)

[ GitHub ]

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

def current_scope=(scope)
  ScopeRegistry.set_current_scope(self, scope)
end

#global_current_scope(skip_inherited_scope = false)

[ GitHub ]

  
# File 'activerecord/lib/active_record/scoping.rb', line 34

def global_current_scope(skip_inherited_scope = false)
  ScopeRegistry.global_current_scope(self, skip_inherited_scope)
end

#global_current_scope=(scope)

[ GitHub ]

  
# File 'activerecord/lib/active_record/scoping.rb', line 38

def global_current_scope=(scope)
  ScopeRegistry.set_global_current_scope(self, scope)
end

#scope_registry

[ GitHub ]

  
# File 'activerecord/lib/active_record/scoping.rb', line 42

def scope_registry
  ScopeRegistry.instance
end