Module: ActiveRecord::Scoping

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

Overview

Active Record Named Scopes

Defined Under Namespace

Modules: ClassMethods, Default, Named Classes: DefaultScope, ScopeRegistry

Instance Method Summary collapse

Methods included from ActiveSupport::Autoload

autoload, autoload_at, autoload_under, eager_autoload, eager_load!, extended

Methods included from ActiveSupport::Concern

append_features, class_methods, extended, included, prepend_features, prepended

Instance Method Details

#initialize_internals_callbackObject

:nodoc:



54
55
56
57
# File 'activerecord/lib/active_record/scoping.rb', line 54

def initialize_internals_callback # :nodoc:
  super
  populate_with_current_scope_attributes
end

#populate_with_current_scope_attributesObject

:nodoc:



47
48
49
50
51
52
# File 'activerecord/lib/active_record/scoping.rb', line 47

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