diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-09-21 13:56:16 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-09-21 13:56:16 +0000 |
commit | 579acce9f60e2e33c23d16aceabda3d2f98c9893 (patch) | |
tree | f3b2e2921ebdab9a4cdbc62c8730d9e74fc4012b /app/models/change.rb | |
parent | 8e7b0a7bac04cafdf290dbcb6243adcdb4542603 (diff) | |
download | redmine-579acce9f60e2e33c23d16aceabda3d2f98c9893.tar.gz redmine-579acce9f60e2e33c23d16aceabda3d2f98c9893.zip |
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
Diffstat (limited to 'app/models/change.rb')
-rw-r--r-- | app/models/change.rb | 3 |
1 files changed, 2 insertions, 1 deletions
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 |