instance method merge_joins

Ruby on Rails 3.2.22.5

Since v3.2.22.5 Last seen in v3.2.22.5 Private

Signature

merge_joins(relation, other)

No documentation comment.

Parameters

relation req
other req
Source
# File activerecord/lib/active_record/relation/spawn_methods.rb, line 150
      def merge_joins(relation, other)
        values = other.joins_values
        return if values.blank?

        if other.klass >= relation.klass
          relation.joins_values += values
        else
          joins_dependency, rest = values.partition do |join|
            case join
            when Hash, Symbol, Array
              true
            else
              false
            end
          end

          join_dependency = ActiveRecord::Associations::JoinDependency.new(
            other.klass,
            joins_dependency,
            []
          )

          relation.joins_values += join_dependency.join_associations + rest
        end
      end

Defined in activerecord/lib/active_record/relation/spawn_methods.rb line 150 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveRecord::SpawnMethods

Type at least 2 characters to search.

↑↓ navigate · open · esc close