##// END OF EJS Templates
Use attribute writers instead of before_create callback to normalize comments and committer (#14534)....
Jean-Philippe Lang -
r13514:0bcd5be0a585
parent child
Show More
@@ -69,6 +69,16 class Changeset < ActiveRecord::Base
69 end
69 end
70 end
70 end
71
71
72 def committer=(arg)
73 write_attribute :committer,
74 self.class.to_utf8(arg, repository.try(:repo_log_encoding))
75 end
76
77 def comments=(arg)
78 write_attribute :comments,
79 self.class.normalize_comments(arg, repository.try(:repo_log_encoding))
80 end
81
72 def committed_on=(date)
82 def committed_on=(date)
73 self.commit_date = date
83 self.commit_date = date
74 super
84 super
@@ -92,9 +102,7 class Changeset < ActiveRecord::Base
92 end
102 end
93
103
94 def before_create_cs
104 def before_create_cs
95 self.committer = self.class.to_utf8(self.committer, repository.repo_log_encoding)
105 self.comments ||= ''
96 self.comments = self.class.normalize_comments(
97 self.comments, repository.repo_log_encoding)
98 self.user = repository.find_committer_user(self.committer)
106 self.user = repository.find_committer_user(self.committer)
99 end
107 end
100
108
General Comments 0
You need to be logged in to leave comments. Login now