Class: ActiveRecord::Reflection::RuntimeReflection

Inherits:
PolymorphicReflection show all
Defined in:
activerecord/lib/active_record/reflection.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from PolymorphicReflection

#get_join_keys, #join_scopes, #plural_name, #scope, #scopes, #type

Methods inherited from AbstractReflection

#alias_candidate, #build_association, #build_join_constraint, #build_scope, #chain, #check_validity_of_inverse!, #class_name, #counter_cache_column, #counter_must_be_updated_by_has_many?, #get_join_keys, #has_cached_counter?, #inverse_of, #inverse_updates_counter_in_memory?, #inverse_which_updates_counter_cache, #join_foreign_key, #join_keys, #join_scope, #join_scopes, #klass_join_scope, #primary_key_type, #quoted_table_name, #scope_chain, #scopes, #table_name, #through_reflection?

Constructor Details

#initialize(reflection, association) ⇒ RuntimeReflection

Returns a new instance of RuntimeReflection.



1082
1083
1084
1085
# File 'activerecord/lib/active_record/reflection.rb', line 1082

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

Instance Attribute Details

#nextObject

Returns the value of attribute next.



1080
1081
1082
# File 'activerecord/lib/active_record/reflection.rb', line 1080

def next
  @next
end

Instance Method Details

#alias_nameObject



1095
1096
1097
# File 'activerecord/lib/active_record/reflection.rb', line 1095

def alias_name
  Arel::Table.new(table_name, type_caster: klass.type_caster)
end

#all_includesObject



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

def all_includes; yield; end

#constraintsObject



1091
1092
1093
# File 'activerecord/lib/active_record/reflection.rb', line 1091

def constraints
  @reflection.constraints
end

#klassObject



1087
1088
1089
# File 'activerecord/lib/active_record/reflection.rb', line 1087

def klass
  @association.klass
end