summaryrefslogtreecommitdiffstats
path: root/app/models/project.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-11-12 17:23:14 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-11-12 17:23:14 +0000
commit5944696b6d4307de0166ba74c514aae25779abb9 (patch)
treec2543b32f0319c9e87efa7074d378e86bd60af78 /app/models/project.rb
parenta727f0d25a1e9f23be869a1dc413485b43a16935 (diff)
downloadredmine-5944696b6d4307de0166ba74c514aae25779abb9.tar.gz
redmine-5944696b6d4307de0166ba74c514aae25779abb9.zip
Custom fields can now be reordered.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@901 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/project.rb')
-rw-r--r--app/models/project.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index 152808c14..1fbab2e4d 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -36,7 +36,13 @@ class Project < ActiveRecord::Base
has_one :repository, :dependent => :destroy
has_many :changesets, :through => :repository
has_one :wiki, :dependent => :destroy
- has_and_belongs_to_many :custom_fields, :class_name => 'IssueCustomField', :join_table => "#{table_name_prefix}custom_fields_projects#{table_name_suffix}", :association_foreign_key => 'custom_field_id'
+ # Custom field for the project issues
+ has_and_belongs_to_many :custom_fields,
+ :class_name => 'IssueCustomField',
+ :order => "#{CustomField.table_name}.position",
+ :join_table => "#{table_name_prefix}custom_fields_projects#{table_name_suffix}",
+ :association_foreign_key => 'custom_field_id'
+
acts_as_tree :order => "name", :counter_cache => true
acts_as_searchable :columns => ['name', 'description'], :project_key => 'id'