summaryrefslogtreecommitdiffstats
path: root/app/models/principal.rb
diff options
context:
space:
mode:
authorEric Davis <edavis@littlestreamsoftware.com>2009-12-12 06:18:45 +0000
committerEric Davis <edavis@littlestreamsoftware.com>2009-12-12 06:18:45 +0000
commitddeaf9da965c1145e65c1552414b3432a5291ea1 (patch)
treebabd74e1f594433962bdfb7073b3c70b385264f0 /app/models/principal.rb
parent7959101288c08181e0a66e56d3047283359b8f0e (diff)
downloadredmine-ddeaf9da965c1145e65c1552414b3432a5291ea1.tar.gz
redmine-ddeaf9da965c1145e65c1552414b3432a5291ea1.zip
Refactor conditions.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3153 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/principal.rb')
-rw-r--r--app/models/principal.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/principal.rb b/app/models/principal.rb
index ff9b6866c..9ec0f6ff8 100644
--- a/app/models/principal.rb
+++ b/app/models/principal.rb
@@ -27,7 +27,7 @@ class Principal < ActiveRecord::Base
named_scope :like, lambda {|q|
s = "%#{q.to_s.strip.downcase}%"
- {:conditions => ["LOWER(login) LIKE ? OR LOWER(firstname) LIKE ? OR LOWER(lastname) LIKE ? OR LOWER(mail) LIKE ?", s, s, s, s],
+ {:conditions => ["LOWER(login) LIKE :s OR LOWER(firstname) LIKE :s OR LOWER(lastname) LIKE :s OR LOWER(mail) LIKE :s", {:s => s}],
:order => 'type, login, lastname, firstname, mail'
}
}