Flowdock
method

new

Importance_0
Ruby on Rails latest stable (v6.1.7.7) - 0 notes - Class: ActiveRecord::Associations::ClassMethods::JoinDependency::JoinAssociation

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v3.0.9) is shown here.

These similar methods exist in v6.1.7.7:

new(reflection, join_dependency, parent = nil) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/associations.rb, line 2100
            def initialize(reflection, join_dependency, parent = nil)
              reflection.check_validity!
              if reflection.options[:polymorphic]
                raise EagerLoadPolymorphicError.new(reflection)
              end

              super(reflection.klass)
              @join_dependency    = join_dependency
              @parent             = parent
              @reflection         = reflection
              @aliased_prefix     = "t#{ join_dependency.joins.size }"
              @parent_table_name  = parent.active_record.table_name
              @aliased_table_name = aliased_table_name_for(table_name)
              @join               = nil
              @join_type          = Arel::InnerJoin

              if reflection.macro == :has_and_belongs_to_many
                @aliased_join_table_name = aliased_table_name_for(reflection.options[:join_table], "_join")
              end

              if [:has_many, :has_one].include?(reflection.macro) && reflection.options[:through]
                @aliased_join_table_name = aliased_table_name_for(reflection.through_reflection.klass.table_name, "_join")
              end
            end
Register or log in to add new notes.