Project

General

Profile

Defect #19884 ยป patch-app_models_user.rb

patch to fix address column ambiguity in user model - Future Link Corporation pkgsrc team, 2015-05-19 22:21

 
1
--- app/models/user.rb.orig	2015-05-17 13:01:37.000000000 -0400
2
+++ app/models/user.rb	2015-05-19 15:47:19.550317983 -0400
3
@@ -130,7 +130,7 @@
4
   scope :having_mail, lambda {|arg|
5
     addresses = Array.wrap(arg).map {|a| a.to_s.downcase}
6
     if addresses.any?
7
-      joins(:email_addresses).where("LOWER(address) IN (?)", addresses).uniq
8
+      joins(:email_addresses).where("LOWER(email_addresses.address) IN (?)", addresses).uniq
9
     else
10
       none
11
     end
    (1-1/1)