##// END OF EJS Templates
scm: code clean up app/models/changeset.rb....
Toshi MARUYAMA -
r5252:b9ce06131913
parent child
Show More
@@ -81,7 +81,8 class Changeset < ActiveRecord::Base
81
81
82 def before_create
82 def before_create
83 self.committer = self.class.to_utf8(self.committer, repository.repo_log_encoding)
83 self.committer = self.class.to_utf8(self.committer, repository.repo_log_encoding)
84 self.comments = self.class.normalize_comments(self.comments, repository.repo_log_encoding)
84 self.comments = self.class.normalize_comments(
85 self.comments, repository.repo_log_encoding)
85 self.user = repository.find_committer_user(self.committer)
86 self.user = repository.find_committer_user(self.committer)
86 end
87 end
87
88
@@ -174,7 +175,9 class Changeset < ActiveRecord::Base
174 return nil if id.blank?
175 return nil if id.blank?
175 issue = Issue.find_by_id(id.to_i, :include => :project)
176 issue = Issue.find_by_id(id.to_i, :include => :project)
176 if issue
177 if issue
177 unless issue.project && (project == issue.project || project.is_ancestor_of?(issue.project) || project.is_descendant_of?(issue.project))
178 unless issue.project &&
179 (project == issue.project || project.is_ancestor_of?(issue.project) ||
180 project.is_descendant_of?(issue.project))
178 issue = nil
181 issue = nil
179 end
182 end
180 end
183 end
@@ -212,7 +215,8 class Changeset < ActiveRecord::Base
212 :hours => hours,
215 :hours => hours,
213 :issue => issue,
216 :issue => issue,
214 :spent_on => commit_date,
217 :spent_on => commit_date,
215 :comments => l(:text_time_logged_by_changeset, :value => text_tag, :locale => Setting.default_language)
218 :comments => l(:text_time_logged_by_changeset, :value => text_tag,
219 :locale => Setting.default_language)
216 )
220 )
217 time_entry.activity = log_time_activity unless log_time_activity.nil?
221 time_entry.activity = log_time_activity unless log_time_activity.nil?
218
222
General Comments 0
You need to be logged in to leave comments. Login now