123456789_123456789_123456789_123456789_123456789_

Class: ActiveRecord::Reflection::RuntimeReflection

Do not use. This class is for internal use only.
Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Inherits: ActiveRecord::Reflection::AbstractReflection
Defined in: activerecord/lib/active_record/reflection.rb

Class Method Summary

Instance Attribute Summary

AbstractReflection - Inherited

#counter_must_be_updated_by_has_many?,
#has_active_cached_counter?

Returns whether this association has a counter cache and its column values were backfilled (and so it is used internally by methods like size/+any?+/etc).

#has_cached_counter?

Returns whether this association has a counter cache.

#inverse_updates_counter_cache?
#inverse_updates_counter_in_memory?, #strict_loading?, #through_reflection?

Instance Method Summary

AbstractReflection - Inherited

#alias_candidate, #association_route_for_join, #association_scope_cache,
#build_association

Returns a new, unsaved instance of the associated class.

#build_scope, #chain, #check_validity_of_inverse!,
#class_name

Returns the class name for the macro.

#constraints, #counter_cache_column, #inverse_of,
#inverse_which_updates_counter_cache

We need to avoid the following situation:

#join_scope, #join_scopes,
#keep_owner_conditions

Re-applies the conditions tying the records to the owner (the key and the polymorphic type) that the association scope removed or replaced, or warns that it does when ActiveRecord.association_scope_keeps_owner_conditions is disabled.

#klass_join_scope

The klass's own scope on table: its STI type condition and default scopes, built on table (which may be an alias) like klass.all is built on its arel_table.

#scopes

Returns a list of scopes that should be applied for this ::ActiveRecord::Reflection object when querying the database.

#strict_loading_violation_message, #table_name,
#actual_source_reflection

FIXME: this is a horrible name.

#ensure_option_not_given_as_class!,
#inferred_primary_key_definition

The Key form of a model's inferred primary key.

#primary_key, #primary_key_definition

Constructor Details

.new(reflection, association, route) ⇒ RuntimeReflection

[ GitHub ]

  
# File 'activerecord/lib/active_record/reflection.rb', line 1606

def initialize(reflection, association, route)
  super()
  @reflection = reflection
  @association = association
  @route = route
end

Instance Attribute Details

#active_record (readonly)

[ GitHub ]

  
# File 'activerecord/lib/active_record/reflection.rb', line 1604

delegate :scope, :type, :constraints, :name, :active_record, to: :@reflection

#constraints (readonly)

[ GitHub ]

  
# File 'activerecord/lib/active_record/reflection.rb', line 1604

delegate :scope, :type, :constraints, :name, :active_record, to: :@reflection

#name (readonly)

[ GitHub ]

  
# File 'activerecord/lib/active_record/reflection.rb', line 1604

delegate :scope, :type, :constraints, :name, :active_record, to: :@reflection

#scope (readonly)

[ GitHub ]

  
# File 'activerecord/lib/active_record/reflection.rb', line 1604

delegate :scope, :type, :constraints, :name, :active_record, to: :@reflection

#type (readonly)

[ GitHub ]

  
# File 'activerecord/lib/active_record/reflection.rb', line 1604

delegate :scope, :type, :constraints, :name, :active_record, to: :@reflection

Instance Method Details

#aliased_table

[ GitHub ]

  
# File 'activerecord/lib/active_record/reflection.rb', line 1617

def aliased_table
  klass.arel_table
end

#all_includes

[ GitHub ]

  
# File 'activerecord/lib/active_record/reflection.rb', line 1625

def all_includes; yield; end

#association_route

[ GitHub ]

  
# File 'activerecord/lib/active_record/reflection.rb', line 1621

def association_route(**)
  @route
end

#klass

[ GitHub ]

  
# File 'activerecord/lib/active_record/reflection.rb', line 1613

def klass
  @association.klass
end