diff options
author | Jan Provaznik <jprovaznik@gitlab.com> | 2019-04-28 08:21:46 +0200 |
---|---|---|
committer | Jan Provaznik <jprovaznik@gitlab.com> | 2019-04-28 08:21:46 +0200 |
commit | ae2dbec2af96fab3a3c0da1da0627ab6514368c9 (patch) | |
tree | 3345d1d58cbb98a0475b6d8689882c6c044bf7a7 | |
parent | ddee4426c4bd3df8bde7936a6ffb0a1973a4d5a1 (diff) | |
download | gitlab-ce-rails-union-fix.tar.gz |
Remove Rails 4 compatibility fixrails-union-fix
This bug was fixed in Rails 5.1 so we don't need it
anymore.
-rw-r--r-- | app/models/concerns/from_union.rb | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/app/models/concerns/from_union.rb b/app/models/concerns/from_union.rb index 9b8595b1211..85d86a704ad 100644 --- a/app/models/concerns/from_union.rb +++ b/app/models/concerns/from_union.rb @@ -36,15 +36,9 @@ module FromUnion # table of the current model. # rubocop: disable Gitlab/Union def from_union(members, remove_duplicates: true, alias_as: table_name) - union = Gitlab::SQL::Union + Gitlab::SQL::Union .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}")]) end # rubocop: enable Gitlab/Union end |