summaryrefslogtreecommitdiffstats
path: root/app/models/enumeration.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/enumeration.rb')
-rw-r--r--app/models/enumeration.rb12
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