]> source.dussan.org Git - redmine.git/commitdiff
Column 'address' in where clause may be ambiguous (#19485).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 30 May 2015 08:23:03 +0000 (08:23 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 30 May 2015 08:23:03 +0000 (08:23 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@14284 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/user.rb

index cdaebcf9e41e8ff7adf9c5c9591dcc2c5ccf7593..70610159f5c60587eeedc2eac82df1c0fef3d899 100644 (file)
@@ -130,7 +130,7 @@ class User < Principal
   scope :having_mail, lambda {|arg|
     addresses = Array.wrap(arg).map {|a| a.to_s.downcase}
     if addresses.any?
-      joins(:email_addresses).where("LOWER(address) IN (?)", addresses).uniq
+      joins(:email_addresses).where("LOWER(#{EmailAddress.table_name}.address) IN (?)", addresses).uniq
     else
       none
     end