Class: ActiveRecord::Reflection::RuntimeReflection

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

Overview

:nodoc:

Instance Method Summary collapse

Methods inherited from AbstractReflection

#alias_candidate, #build_association, #build_scope, #chain, #check_validity_of_inverse!, #class_name, #constraints, #counter_cache_column, #counter_must_be_updated_by_has_many?, #has_cached_counter?, #inverse_of, #inverse_updates_counter_in_memory?, #inverse_which_updates_counter_cache, #join_scope, #join_scopes, #klass_join_scope, #scopes, #strict_loading?, #strict_loading_violation_message, #table_name, #through_reflection?

Constructor Details

#initialize(reflection, association) ⇒ RuntimeReflection

Returns a new instance of RuntimeReflection.



1202
1203
1204
1205
1206
# File 'lib/active_record/reflection.rb', line 1202

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

Instance Method Details

#aliased_tableObject



1212
1213
1214
# File 'lib/active_record/reflection.rb', line 1212

def aliased_table
  klass.arel_table
end

#all_includesObject



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

def all_includes; yield; end

#join_primary_key(klass = self.klass) ⇒ Object



1216
1217
1218
# File 'lib/active_record/reflection.rb', line 1216

def join_primary_key(klass = self.klass)
  @reflection.join_primary_key(klass)
end

#klassObject



1208
1209
1210
# File 'lib/active_record/reflection.rb', line 1208

def klass
  @association.klass
end