Class: ActiveRecord::Reflection::RuntimeReflection

Inherits:
PolymorphicReflection show all
Defined in:
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

#build_association, #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_keys, #join_scopes, #klass_join_scope, #primary_key_type, #quoted_table_name, #scope_chain, #scopes, #through_reflection?

Constructor Details

#initialize(reflection, association) ⇒ RuntimeReflection

Returns a new instance of RuntimeReflection.



1082
1083
1084
1085
# File '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 'lib/active_record/reflection.rb', line 1080

def next
  @next
end

Instance Method Details

#alias_candidate(name) ⇒ Object



1103
1104
1105
# File 'lib/active_record/reflection.rb', line 1103

def alias_candidate(name)
  "#{plural_name}_#{name}_join"
end

#alias_nameObject



1107
1108
1109
# File 'lib/active_record/reflection.rb', line 1107

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

#all_includesObject



1111
# File 'lib/active_record/reflection.rb', line 1111

def all_includes; yield; end

#constraintsObject



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

def constraints
  @reflection.constraints
end

#klassObject



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

def klass
  @association.klass
end

#source_type_infoObject



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

def source_type_info
  @reflection.source_type_info
end

#table_nameObject



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

def table_name
  klass.table_name
end