diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2015-10-29 13:33:20 +0100 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2015-10-30 12:00:58 +0100 |
commit | bba46623c20de52942c85eb2aba3649e3f4ba296 (patch) | |
tree | 227e4c220831fb79d4cf0f7145f5a796394ad259 /app | |
parent | 24c8f42278844cf48cdd9871b8285445379623f0 (diff) | |
download | gitlab-ce-bba46623c20de52942c85eb2aba3649e3f4ba296.tar.gz |
Fixed UNION syntax for MySQL
MySQL doesn't support the previous syntax.
Diffstat (limited to 'app')
-rw-r--r-- | app/models/user.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index 35f5ab56798..66db70080b7 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -238,9 +238,9 @@ class User < ActiveRecord::Base # Arel doesn't allow for chaining operations on union nodes, thus we have # to write this query by hand. See the following issue for more info: # https://github.com/rails/arel/issues/98. - sql = '(SELECT * FROM users WHERE email = :email + sql = '(SELECT * FROM users WHERE email = :email) UNION - SELECT users.* + (SELECT users.* FROM emails INNER JOIN users ON users.id = emails.user_id WHERE emails.email = :email) |