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

@@ -36,7 +36,7 @@ class Enumeration < ActiveRecord::Base
validates_length_of :name, :maximum => 30
scope :shared, lambda { where(:project_id => nil) }
scope :sorted, lambda { order("#{table_name}.position ASC") }
scope :sorted, lambda { order(:position) }
scope :active, lambda { where(:active => true) }
scope :system, lambda { where(:project_id => nil) }
scope :named, lambda {|arg| where("LOWER(#{table_name}.name) = LOWER(?)", arg.to_s.strip)}