Sha256: 80b4b3fc0a7d939be5f38610d766c17b8776ac0cc800fefbdcbc81ec389b3fde
Contents?: true
Size: 875 Bytes
Versions: 2
Compression:
Stored size: 875 Bytes
Contents
module ActiveRecord module Associations # Helper class module which gets mixed into JoinDependency::JoinAssociation and AssociationScope module JoinHelper #:nodoc: def join_type Arel::InnerJoin end private def construct_tables chain.map do |reflection| alias_tracker.aliased_table_for( table_name_for(reflection), table_alias_for(reflection, reflection != self.reflection) ) end end def table_name_for(reflection) reflection.table_name end def table_alias_for(reflection, join = false) name = "#{reflection.plural_name}_#{alias_suffix}" name << "_join" if join name end def join(table, constraint) table.create_join(table, table.create_on(constraint), join_type) end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
activerecord-4.1.0.beta2 | lib/active_record/associations/join_helper.rb |
activerecord-4.1.0.beta1 | lib/active_record/associations/join_helper.rb |