From 579acce9f60e2e33c23d16aceabda3d2f98c9893 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Wed, 21 Sep 2011 13:56:16 +0000 Subject: Rails3: model: replace deprecated 'before_validation' method at Change model git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7435 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/change.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app/models/change.rb') diff --git a/app/models/change.rb b/app/models/change.rb index a5cfccf22..f509f5806 100644 --- a/app/models/change.rb +++ b/app/models/change.rb @@ -20,12 +20,13 @@ class Change < ActiveRecord::Base validates_presence_of :changeset_id, :action, :path before_save :init_path + before_validation :replace_invalid_utf8_of_path def relative_path changeset.repository.relative_path(path) end - def before_validation + def replace_invalid_utf8_of_path self.path = Redmine::CodesetUtil.replace_invalid_utf8(self.path) self.from_path = Redmine::CodesetUtil.replace_invalid_utf8(self.from_path) end -- cgit v1.2.3