##// END OF EJS Templates
Rails3: replace deprecated 'before_create' to declared method at Changeset model....
Toshi MARUYAMA -
r6624:bc169cf466db
parent child
Show More
@@ -45,6 +45,7 class Changeset < ActiveRecord::Base
45 :conditions => Project.allowed_to_condition(args.shift || User.current, :view_changesets, *args) } }
45 :conditions => Project.allowed_to_condition(args.shift || User.current, :view_changesets, *args) } }
46
46
47 after_create :scan_for_issues
47 after_create :scan_for_issues
48 before_create :before_create_cs
48
49
49 def revision=(r)
50 def revision=(r)
50 write_attribute :revision, (r.nil? ? nil : r.to_s)
51 write_attribute :revision, (r.nil? ? nil : r.to_s)
@@ -81,7 +82,7 class Changeset < ActiveRecord::Base
81 user || committer.to_s.split('<').first
82 user || committer.to_s.split('<').first
82 end
83 end
83
84
84 def before_create
85 def before_create_cs
85 self.committer = self.class.to_utf8(self.committer, repository.repo_log_encoding)
86 self.committer = self.class.to_utf8(self.committer, repository.repo_log_encoding)
86 self.comments = self.class.normalize_comments(
87 self.comments = self.class.normalize_comments(
87 self.comments, repository.repo_log_encoding)
88 self.comments, repository.repo_log_encoding)
General Comments 0
You need to be logged in to leave comments. Login now