Commit 01317505 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Pass string directly to #from

parent 056166db
...@@ -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