summaryrefslogtreecommitdiffstats
path: root/app/models/custom_field.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/custom_field.rb')
-rw-r--r--app/models/custom_field.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/custom_field.rb b/app/models/custom_field.rb
index 81c8aae06..c3b5f2a9f 100644
--- a/app/models/custom_field.rb
+++ b/app/models/custom_field.rb
@@ -17,6 +17,7 @@
class CustomField < ActiveRecord::Base
has_many :custom_values, :dependent => :delete_all
+ acts_as_list :scope => 'type = \'#{self.class}\''
serialize :possible_values
FIELD_FORMATS = { "string" => { :name => :label_string, :order => 1 },
@@ -51,6 +52,10 @@ class CustomField < ActiveRecord::Base
end
end
+ def <=>(field)
+ position <=> field.position
+ end
+
# to move in project_custom_field
def self.for_all
find(:all, :conditions => ["is_for_all=?", true])