Module: ActiveRecord::Scoping

Extended by:
ActiveSupport::Autoload, ActiveSupport::Concern
Included in:
Base
Defined in:
lib/active_record/scoping/named.rb,
lib/active_record.rb,
lib/active_record/scoping.rb,
lib/active_record/scoping/default.rb

Overview

Active Record Named Scopes

Defined Under Namespace

Modules: ClassMethods, Default, Named Classes: ScopeRegistry

Instance Method Summary collapse

Instance Method Details

#initialize_internals_callbackObject

:nodoc:



42
43
44
45
# File 'lib/active_record/scoping.rb', line 42

def initialize_internals_callback # :nodoc:
  super
  populate_with_current_scope_attributes
end

#populate_with_current_scope_attributesObject

:nodoc:



35
36
37
38
39
40
# File 'lib/active_record/scoping.rb', line 35

def populate_with_current_scope_attributes # :nodoc:
  return unless self.class.scope_attributes?

  attributes = self.class.scope_attributes
  _assign_attributes(attributes) if attributes.any?
end