class ActiveRecord::Associations::JoinDependency::JoinPart
:nodoc:
two; one for the join table and one for the target table).
operations (for example a has_and_belongs_to_many JoinAssociation would result in
is joining to the base. A JoinAssociation may result in more than one actual join
everything else is being joined onto. A JoinAssociation represents an association which
by JoinBase and JoinAssociation. A JoinBase represents the Active Record which
A JoinPart represents a part of a JoinDependency. It is inherited
:nodoc:
def each(&block)
def each(&block) yield self children.each { |child| child.each(&block) } end
def each_children(&block)
def each_children(&block) children.each do |child| yield self, child child.each_children(&block) end end
def extract_record(row, column_names_with_alias)
def extract_record(row, column_names_with_alias) # This code is performance critical as it is called per row. # see: https://github.com/rails/rails/pull/12185 hash = {} index = 0 length = column_names_with_alias.length while index < length column = column_names_with_alias[index] hash[column.name] = row[column.alias] index += 1 end hash end
def initialize(base_klass, children)
def initialize(base_klass, children) @base_klass = base_klass @children = children end
def instantiate(row, aliases, column_types = {}, &block)
def instantiate(row, aliases, column_types = {}, &block) base_klass.instantiate(extract_record(row, aliases), column_types, &block) end
def match?(other)
def match?(other) self.class == other.class end
def table
def table raise NotImplementedError end