]> source.dussan.org Git - redmine.git/commitdiff
Rails3: model: replace deprecated 'before_validation' method at Change model
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Wed, 21 Sep 2011 13:56:16 +0000 (13:56 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Wed, 21 Sep 2011 13:56:16 +0000 (13:56 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7435 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/change.rb

index a5cfccf22c662c67c8c6aa10f52b54e9acdf82af..f509f5806fd235297151896e05f75d42eff5c13c 100644 (file)
@@ -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