gitlab-org--gitlab-foss/lib/gitlab/database/subquery.rb
Toon Claes d5080eb5ff Revert "Workaround for Rails 5, where LIMIT..."
This reverts commit 6823e7defb.

Originally implemented in
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/21839, but an
error was reported in
https://gitlab.com/gitlab-org/gitlab-ce/issues/51729 resulting in a
workaround introduced in
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/21879.

Now Rails 5.2 is used, this workaround no longer seems needed, so this
reverts it.
2019-07-16 14:09:11 +02:00

16 lines
336 B
Ruby

# frozen_string_literal: true
module Gitlab
module Database
module Subquery
class << self
def self_join(relation)
t = relation.arel_table
t2 = relation.arel.as('t2')
relation.unscoped.joins(t.join(t2).on(t[:id].eq(t2[:id])).join_sources.first)
end
end
end
end
end