Order scopes cleanup.

git-svn-id: http://svn.redmine.org/redmine/trunk@13526 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2014-10-29 21:49:33 +00:00
parent 47e74dc689
commit 522bebe5ed
6 changed files with 7 additions and 7 deletions

View File

@@ -41,7 +41,7 @@ class Tracker < ActiveRecord::Base
validates_uniqueness_of :name
validates_length_of :name, :maximum => 30
scope :sorted, lambda { order("#{table_name}.position ASC") }
scope :sorted, lambda { order(:position) }
scope :named, lambda {|arg| where("LOWER(#{table_name}.name) = LOWER(?)", arg.to_s.strip)}
def to_s; name end