Commit a0610758 authored by Robert Speicher's avatar Robert Speicher

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
parents 7fa7f7ac 01317505
...@@ -40,11 +40,7 @@ module FromUnion ...@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment