Merge branch '51575-remove-rails-4-specific-code-from-fromunion-from_union' into 'master'

Remove Rails 4-specific code from `FromUnion.from_union`

Closes #51575

See merge request gitlab-org/gitlab-ce!30587
This commit is contained in:
Robert Speicher 2019-07-11 16:18:04 +00:00
commit a06107582f
1 changed files with 1 additions and 5 deletions

View File

@ -40,11 +40,7 @@ module FromUnion
.new(members, remove_duplicates: remove_duplicates)
.to_sql
# This pattern is necessary as a bug in Rails 4 can cause the use of
# `from("string here").includes(:foo)` to break ActiveRecord. This is
# fixed in https://github.com/rails/rails/pull/25374, which is released as
# part of Rails 5.
from([Arel.sql("(#{union}) #{alias_as}")])
from(Arel.sql("(#{union}) #{alias_as}"))
end
# rubocop: enable Gitlab/Union
end