class RuboCop::Cop::Rails::RootJoinChain

def evidence(node)

def evidence(node)
  # Are we at the *end* of the join chain?
  return if join?(node.parent)
  # Is there only one join?
  return if rails_root?(node.receiver)
  all_args = []
  while (args = join?(node))
    all_args = args + all_args
    node = node.receiver
  end
  rails_root?(node) do
    yield(node, all_args)
  end
end