-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
Signed-off-by: Alex Coles <alex@alexbcoles.com>
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -96,8 +96,6 @@ def author | |
def repository_encoding | ||
if repository.present? | ||
repository.repo_log_encoding | ||
else | ||
nil | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
myabc
Author
Owner
|
||
end | ||
end | ||
|
||
|
@@ -138,11 +136,13 @@ def scan_comment_for_work_package_ids | |
referenced_work_packages = [] | ||
|
||
comments.scan(/([\s\(\[,-]|^)((#{kw_regexp})[\s:]+)?(#\d+(\s+@#{TIMELOG_RE})?([\s,;&]+#\d+(\s+@#{TIMELOG_RE})?)*)(?=[[:punct:]]|\s|<|$)/i) do |match| | ||
action, refs = match[2], match[3] | ||
action = match[2] | ||
refs = match[3] | ||
next unless action.present? || ref_keywords_any | ||
|
||
refs.scan(/#(\d+)(\s+@#{TIMELOG_RE})?/).each do |m| | ||
work_package, hours = find_referenced_work_package_by_id(m[0].to_i), m[2] | ||
work_package = find_referenced_work_package_by_id(m[0].to_i) | ||
hours = m[2] | ||
if work_package | ||
referenced_work_packages << work_package | ||
fix_work_package(work_package) if fix_keywords.include?(action.to_s.downcase) | ||
|
@@ -237,7 +237,7 @@ def log_time(work_package, hours) | |
work_package: work_package, | ||
spent_on: commit_date, | ||
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? | ||
|
||
unless time_entry.save | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,7 +92,7 @@ def self.merge_reference_journals_by_id(current, predecessor, key) | |
all_attachable_journal_ids = current.map { |j| j[key] } | predecessor.map { |j| j[key] } | ||
|
||
all_attachable_journal_ids.each_with_object({}) { |i, h| | ||
h[i] = [predecessor.detect { |j| j[key] == i }, | ||
h[i] = [predecessor.detect do |j| j[key] == i end, | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
myabc
Author
Owner
|
||
current.detect { |j| j[key] == i }] | ||
} | ||
end | ||
|
@@ -213,8 +213,7 @@ def self.journaled_class(journal_type) | |
|
||
def self.normalize_newlines(data) | ||
data.each_with_object({}) { |e, h| | ||
h[e[0]] = (e[1].is_a?(String) ? e[1].gsub(/\r\n/, "\n") | ||
: e[1]) | ||
h[e[0]] = (e[1].is_a?(String) ? e[1].gsub(/\r\n/, "\n") : e[1]) | ||
} | ||
end | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -104,8 +104,6 @@ def project | |
journaled.project | ||
elsif journaled.is_a? Project | ||
journaled | ||
else | ||
nil | ||
end | ||
end | ||
|
||
|
I actually like explicit return statements.
If you asked me I would even write
return
in most of the cases... This might be my view alone, not sure...