mirror of
https://github.com/meineerde/redmine.git
synced 2025-12-20 07:21:12 +00:00
Don't compare LOWER() with #downcase.
git-svn-id: http://svn.redmine.org/redmine/trunk@16480 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
f604fe9460
commit
d8dec34ece
@ -103,11 +103,9 @@ class Project < ActiveRecord::Base
|
|||||||
where(Project.allowed_to_condition(user, permission, *args))
|
where(Project.allowed_to_condition(user, permission, *args))
|
||||||
}
|
}
|
||||||
scope :like, lambda {|arg|
|
scope :like, lambda {|arg|
|
||||||
if arg.blank?
|
if arg.present?
|
||||||
where(nil)
|
pattern = "%#{arg.to_s.strip}%"
|
||||||
else
|
where("LOWER(identifier) LIKE LOWER(:p) OR LOWER(name) LIKE LOWER(:p)", :p => pattern)
|
||||||
pattern = "%#{arg.to_s.strip.downcase}%"
|
|
||||||
where("LOWER(identifier) LIKE :p OR LOWER(name) LIKE :p", :p => pattern)
|
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
scope :sorted, lambda {order(:lft)}
|
scope :sorted, lambda {order(:lft)}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user