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:
commit
a06107582f
1 changed files with 1 additions and 5 deletions
|
@ -40,11 +40,7 @@ module FromUnion
|
||||||
.new(members, remove_duplicates: remove_duplicates)
|
.new(members, remove_duplicates: remove_duplicates)
|
||||||
.to_sql
|
.to_sql
|
||||||
|
|
||||||
# This pattern is necessary as a bug in Rails 4 can cause the use of
|
from(Arel.sql("(#{union}) #{alias_as}"))
|
||||||
# `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}")])
|
|
||||||
end
|
end
|
||||||
# rubocop: enable Gitlab/Union
|
# rubocop: enable Gitlab/Union
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue