Flowdock
method

merge_joins

Importance_0
v2.3.2 - Show latest stable - 0 notes - Class: ActiveRecord::Base
merge_joins(*joins) private

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/base.rb, line 1707
        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
Register or log in to add new notes.