class ActiveRecord::Scoping::ScopeRegistry

:nodoc:
You will obtain whatever was defined in some_new_scope.
registry.current_scope(Board)
Now when you run:
registry.set_current_scope(Board, some_new_scope)
registry = ActiveRecord::Scoping::ScopeRegistry
following code:
to get the current_scope for the Board model, then you would use the
classes and different types of scopes. For example, if you are attempting
This class allows you to store and get the scope values on different
local depending on the application configuration.
for different classes. The registry is stored as either a thread or fiber
This class stores the :current_scope and :ignore_default_scope values

def current_scope(model, skip_inherited_scope = false)

def current_scope(model, skip_inherited_scope = false)
  value_for(@current_scope, model, skip_inherited_scope)
end

def global_current_scope(model, skip_inherited_scope = false)

def global_current_scope(model, skip_inherited_scope = false)
  value_for(@global_current_scope, model, skip_inherited_scope)
end

def ignore_default_scope(model, skip_inherited_scope = false)

def ignore_default_scope(model, skip_inherited_scope = false)
  value_for(@ignore_default_scope, model, skip_inherited_scope)
end

def initialize

def initialize
  @current_scope        = {}
  @ignore_default_scope = {}
  @global_current_scope = {}
end

def instance

def instance
  ActiveSupport::IsolatedExecutionState[:active_record_scope_registry] ||= new
end

def set_current_scope(model, value)

def set_current_scope(model, value)
  set_value_for(@current_scope, model, value)
end

def set_global_current_scope(model, value)

def set_global_current_scope(model, value)
  set_value_for(@global_current_scope, model, value)
end

def set_ignore_default_scope(model, value)

def set_ignore_default_scope(model, value)
  set_value_for(@ignore_default_scope, model, value)
end

def set_value_for(scope_type, model, value)

Sets the +value+ for a given +scope_type+ and +model+.
def set_value_for(scope_type, model, value)
  scope_type[model.name] = value
end

def value_for(scope_type, model, skip_inherited_scope = false)

Obtains the value for a given +scope_type+ and +model+.
def value_for(scope_type, model, skip_inherited_scope = false)
  return scope_type[model.name] if skip_inherited_scope
  klass = model
  base = model.base_class
  while klass <= base
    value = scope_type[klass.name]
    return value if value
    klass = klass.superclass
  end
end