@@ -77,7 +77,7 class EnumerationsController < ApplicationController | |||||
77 | return |
|
77 | return | |
78 | end |
|
78 | end | |
79 | end |
|
79 | end | |
80 | @enumerations = @enumeration.class.all - [@enumeration] |
|
80 | @enumerations = @enumeration.class.system.all - [@enumeration] | |
81 | end |
|
81 | end | |
82 |
|
82 | |||
83 | private |
|
83 | private |
@@ -38,6 +38,7 class Enumeration < ActiveRecord::Base | |||||
38 | scope :shared, lambda { where(:project_id => nil) } |
|
38 | scope :shared, lambda { where(:project_id => nil) } | |
39 | scope :sorted, lambda { order("#{table_name}.position ASC") } |
|
39 | scope :sorted, lambda { order("#{table_name}.position ASC") } | |
40 | scope :active, lambda { where(:active => true) } |
|
40 | scope :active, lambda { where(:active => true) } | |
|
41 | scope :system, lambda { where(:project_id => nil) } | |||
41 | scope :named, lambda {|arg| where("LOWER(#{table_name}.name) = LOWER(?)", arg.to_s.strip)} |
|
42 | scope :named, lambda {|arg| where("LOWER(#{table_name}.name) = LOWER(?)", arg.to_s.strip)} | |
42 |
|
43 | |||
43 | def self.default |
|
44 | def self.default |
General Comments 0
You need to be logged in to leave comments.
Login now