diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-10-17 17:29:27 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-10-17 17:29:27 +0000 |
commit | d62b90db7327be488007d382f84c469f9fbe4ffe (patch) | |
tree | 153cfe41553b040154ecc89605b797864a76f3c1 /app/models | |
parent | fcb22595d0e87a2d04fb0210c775efdab6cfffa6 (diff) | |
download | redmine-d62b90db7327be488007d382f84c469f9fbe4ffe.tar.gz redmine-d62b90db7327be488007d382f84c469f9fbe4ffe.zip |
Makes enumerations available through the REST API.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10664 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/enumeration.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/enumeration.rb b/app/models/enumeration.rb index d4564a036..d3454021f 100644 --- a/app/models/enumeration.rb +++ b/app/models/enumeration.rb @@ -36,6 +36,7 @@ class Enumeration < ActiveRecord::Base validates_length_of :name, :maximum => 30 scope :shared, where(:project_id => nil) + scope :sorted, order("#{table_name}.position ASC") scope :active, where(:active => true) scope :named, lambda {|arg| where("LOWER(#{table_name}.name) = LOWER(?)", arg.to_s.strip)} |