Fixes custom fields display order at several places (#1768).

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1731 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2008-08-11 18:24:39 +00:00
parent 1631019026
commit 237a3f52a2
7 changed files with 10 additions and 7 deletions
@@ -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? }