diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-07-15 15:33:17 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-07-15 15:33:17 +0000 |
commit | 7946f4a69668ac5ce1699b4c5940482497b929ed (patch) | |
tree | dc77877d26daf053e8b3182bc223260e16872268 /app | |
parent | cb09055d60a711438cb90259d8616def79586d57 (diff) | |
download | redmine-7946f4a69668ac5ce1699b4c5940482497b929ed.tar.gz redmine-7946f4a69668ac5ce1699b4c5940482497b929ed.zip |
Adds a sorted scope to IssueStatus model.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9989 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r-- | app/models/issue_status.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/issue_status.rb b/app/models/issue_status.rb index 1562d049a..95c7e4d51 100644 --- a/app/models/issue_status.rb +++ b/app/models/issue_status.rb @@ -28,6 +28,7 @@ class IssueStatus < ActiveRecord::Base validates_length_of :name, :maximum => 30 validates_inclusion_of :default_done_ratio, :in => 0..100, :allow_nil => true + scope :sorted, order("#{table_name}.position ASC") scope :named, lambda {|arg| where(["LOWER(#{table_name}.name) = LOWER(?)", arg.to_s.strip])} def update_default |