method

merge_joins

rails latest stable - Class: ActiveRecord::Base

Method deprecated or moved

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

merge_joins(*joins)
private

No documentation available.

# File activerecord/lib/active_record/base.rb, line 1732
        def merge_joins(*joins)
          if joins.any?{|j| j.is_a?(String) || array_of_strings?(j) }
            joins = joins.collect do |join|
              join = [join] if join.is_a?(String)
              unless array_of_strings?(join)
                join_dependency = ActiveRecord::Associations::ClassMethods::InnerJoinDependency.new(self, join, nil)
                join = join_dependency.join_associations.collect { |assoc| assoc.association_join }
              end
              join
            end
            joins.flatten.map{|j| j.strip}.uniq
          else
            joins.collect{|j| safe_to_array(j)}.flatten.uniq
          end
        end