diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-11-21 12:00:49 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-11-21 12:00:49 +0000 |
commit | d8c5549168f3fe7e9f2b1633e70928178665773a (patch) | |
tree | 952fc56cbd0f0c5f6b3b7e81c4a50e905f859597 /app/models/enumeration.rb | |
parent | 4bdfef4dc4e09f9ccc4cb3cd3bfbc00d553017b5 (diff) | |
download | redmine-d8c5549168f3fe7e9f2b1633e70928178665773a.tar.gz redmine-d8c5549168f3fe7e9f2b1633e70928178665773a.zip |
Changes misleading scopes on Enumeration.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3083 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/enumeration.rb')
-rw-r--r-- | app/models/enumeration.rb | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/app/models/enumeration.rb b/app/models/enumeration.rb index f219a4c7c..4836229b1 100644 --- a/app/models/enumeration.rb +++ b/app/models/enumeration.rb @@ -16,6 +16,8 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. class Enumeration < ActiveRecord::Base + default_scope :order => "#{Enumeration.table_name}.position ASC" + belongs_to :project acts_as_list :scope => 'type = \'#{type}\'' @@ -58,14 +60,8 @@ class Enumeration < ActiveRecord::Base end # End backwards compatiblity named_scopes - named_scope :all, :order => 'position', :conditions => { :project_id => nil } - - named_scope :active, lambda { - { - :conditions => {:active => true, :project_id => nil}, - :order => 'position' - } - } + named_scope :shared, :conditions => { :project_id => nil } + named_scope :active, :conditions => { :active => true } def self.default # Creates a fake default scope so Enumeration.default will check |