From: Jean-Philippe Lang Date: Tue, 22 Nov 2011 20:54:51 +0000 (+0000) Subject: before_validation_on_create callback removed in Rails 3.1. X-Git-Tag: 1.3.0~126 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=9fa6b263507b762ba7e89461b87fbc9e9508f578;p=redmine.git before_validation_on_create callback removed in Rails 3.1. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7886 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- 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 10ba12341..a09dffbb5 100644 --- a/vendor/plugins/acts_as_customizable/lib/acts_as_customizable.rb +++ b/vendor/plugins/acts_as_customizable/lib/acts_as_customizable.rb @@ -31,7 +31,7 @@ module Redmine :include => :custom_field, :order => "#{CustomField.table_name}.position", :dependent => :delete_all - before_validation_on_create { |customized| customized.custom_field_values } + before_validation { |customized| customized.custom_field_values if customized.new_record? } # Trigger validation only if custom values were changed validates_associated :custom_values, :on => :update, :if => Proc.new { |customized| customized.custom_field_values_changed? } send :include, Redmine::Acts::Customizable::InstanceMethods