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, #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_keys, #join_scope, #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.



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

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

Instance Attribute Details

#nextObject

Returns the value of attribute next.



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

def next
  @next
end

Instance Method Details

#alias_candidate(name) ⇒ Object



1115
1116
1117
# File 'lib/active_record/reflection.rb', line 1115

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

#alias_nameObject



1119
1120
1121
# File 'lib/active_record/reflection.rb', line 1119

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

#all_includesObject



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

def all_includes; yield; end

#constraintsObject



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

def constraints
  @reflection.constraints
end

#klassObject



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

def klass
  @association.klass
end

#source_type_infoObject



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

def source_type_info
  @reflection.source_type_info
end

#table_nameObject



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

def table_name
  klass.table_name
end