summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-01-29 21:12:10 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-01-29 21:12:10 +0000
commitcd4a19241ad77c23bb32ad3214ae3540cbabf5cd (patch)
treef9344663266df69208f030a0f01a4f782ad23c14 /app
parentf84688687bcbf1eb9f5384ed1598100a45736078 (diff)
downloadredmine-cd4a19241ad77c23bb32ad3214ae3540cbabf5cd.tar.gz
redmine-cd4a19241ad77c23bb32ad3214ae3540cbabf5cd.zip
Code cleanup.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8724 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/helpers/issues_helper.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb
index e0e47e414..0b33d48fb 100644
--- a/app/helpers/issues_helper.rb
+++ b/app/helpers/issues_helper.rb
@@ -203,26 +203,26 @@ module IssuesHelper
when 'attr'
field = detail.prop_key.to_s.gsub(/\_id$/, "")
label = l(("field_" + field).to_sym)
- case
- when ['due_date', 'start_date'].include?(detail.prop_key)
+ case detail.prop_key
+ when 'due_date', 'start_date'
value = format_date(detail.value.to_date) if detail.value
old_value = format_date(detail.old_value.to_date) if detail.old_value
- when ['project_id', 'status_id', 'tracker_id', 'assigned_to_id',
- 'priority_id', 'category_id', 'fixed_version_id'].include?(detail.prop_key)
+ when 'project_id', 'status_id', 'tracker_id', 'assigned_to_id',
+ 'priority_id', 'category_id', 'fixed_version_id'
value = find_name_by_reflection(field, detail.value)
old_value = find_name_by_reflection(field, detail.old_value)
- when detail.prop_key == 'estimated_hours'
+ when 'estimated_hours'
value = "%0.02f" % detail.value.to_f unless detail.value.blank?
old_value = "%0.02f" % detail.old_value.to_f unless detail.old_value.blank?
- when detail.prop_key == 'parent_id'
+ when 'parent_id'
label = l(:field_parent_issue)
value = "##{detail.value}" unless detail.value.blank?
old_value = "##{detail.old_value}" unless detail.old_value.blank?
- when detail.prop_key == 'is_private'
+ when 'is_private'
value = l(detail.value == "0" ? :general_text_No : :general_text_Yes) unless detail.value.blank?
old_value = l(detail.old_value == "0" ? :general_text_No : :general_text_Yes) unless detail.old_value.blank?
end
@@ -265,10 +265,10 @@ module IssuesHelper
s << " (#{ diff_link })"
end
s.html_safe
- elsif !detail.value.blank?
+ elsif detail.value.present?
case detail.property
when 'attr', 'cf'
- if !detail.old_value.blank?
+ if detail.old_value.present?
l(:text_journal_changed, :label => label, :old => old_value, :new => value).html_safe
elsif multiple
l(:text_journal_added, :label => label, :value => value).html_safe