scm: code clean up app/models/changeset.rb.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5372 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
c12453ec4e
commit
b9ce061319
@ -81,7 +81,8 @@ class Changeset < ActiveRecord::Base
|
|||||||
|
|
||||||
def before_create
|
def before_create
|
||||||
self.committer = self.class.to_utf8(self.committer, repository.repo_log_encoding)
|
self.committer = self.class.to_utf8(self.committer, repository.repo_log_encoding)
|
||||||
self.comments = self.class.normalize_comments(self.comments, repository.repo_log_encoding)
|
self.comments = self.class.normalize_comments(
|
||||||
|
self.comments, repository.repo_log_encoding)
|
||||||
self.user = repository.find_committer_user(self.committer)
|
self.user = repository.find_committer_user(self.committer)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -174,7 +175,9 @@ class Changeset < ActiveRecord::Base
|
|||||||
return nil if id.blank?
|
return nil if id.blank?
|
||||||
issue = Issue.find_by_id(id.to_i, :include => :project)
|
issue = Issue.find_by_id(id.to_i, :include => :project)
|
||||||
if issue
|
if issue
|
||||||
unless issue.project && (project == issue.project || project.is_ancestor_of?(issue.project) || project.is_descendant_of?(issue.project))
|
unless issue.project &&
|
||||||
|
(project == issue.project || project.is_ancestor_of?(issue.project) ||
|
||||||
|
project.is_descendant_of?(issue.project))
|
||||||
issue = nil
|
issue = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -212,7 +215,8 @@ class Changeset < ActiveRecord::Base
|
|||||||
:hours => hours,
|
:hours => hours,
|
||||||
:issue => issue,
|
:issue => issue,
|
||||||
:spent_on => commit_date,
|
:spent_on => commit_date,
|
||||||
:comments => l(:text_time_logged_by_changeset, :value => text_tag, :locale => Setting.default_language)
|
:comments => l(:text_time_logged_by_changeset, :value => text_tag,
|
||||||
|
:locale => Setting.default_language)
|
||||||
)
|
)
|
||||||
time_entry.activity = log_time_activity unless log_time_activity.nil?
|
time_entry.activity = log_time_activity unless log_time_activity.nil?
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user