summaryrefslogtreecommitdiffstats
path: root/vendor
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2008-08-11 18:24:39 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2008-08-11 18:24:39 +0000
commit237a3f52a2d9d269b56f5cdb022f0ff4f8197100 (patch)
treeb392885d15032d8ae09af3106fffa7779c4bec15 /vendor
parent1631019026089cb7dc49b50365274bb07ba44025 (diff)
downloadredmine-237a3f52a2d9d269b56f5cdb022f0ff4f8197100.tar.gz
redmine-237a3f52a2d9d269b56f5cdb022f0ff4f8197100.zip
Fixes custom fields display order at several places (#1768).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1731 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'vendor')
-rw-r--r--vendor/plugins/acts_as_customizable/lib/acts_as_customizable.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/vendor/plugins/acts_as_customizable/lib/acts_as_customizable.rb b/vendor/plugins/acts_as_customizable/lib/acts_as_customizable.rb
index 05857d0a0..a5598dbd2 100644
--- a/vendor/plugins/acts_as_customizable/lib/acts_as_customizable.rb
+++ b/vendor/plugins/acts_as_customizable/lib/acts_as_customizable.rb
@@ -27,7 +27,10 @@ module Redmine
return if self.included_modules.include?(Redmine::Acts::Customizable::InstanceMethods)
cattr_accessor :customizable_options
self.customizable_options = options
- has_many :custom_values, :dependent => :delete_all, :as => :customized
+ has_many :custom_values, :as => :customized,
+ :include => :custom_field,
+ :order => "#{CustomField.table_name}.position",
+ :dependent => :delete_all
before_validation_on_create { |customized| customized.custom_field_values }
# Trigger validation only if custom values were changed
validates_associated :custom_values, :on => :update, :if => Proc.new { |customized| customized.custom_field_values_changed? }