Last active
December 30, 2015 19:19
-
-
Save binaryphile/7873836 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def email_issue_attributes(issue) | |
items = [] | |
%w(author status priority assigned_to category fixed_version).each do |attribute| | |
unless issue.disabled_core_fields.include?(attribute+"_id") | |
items << "#{l("field_#{attribute}")}: #{issue.send attribute}" | |
end | |
end | |
issue.custom_field_values.each do |value| | |
items << "#{value.custom_field.name}: #{show_value(value)}" | |
end | |
items | |
end | |
def render_email_issue_attributes(issue, html=false) | |
items = email_issue_attributes(issue) | |
if html | |
content_tag('ul', items.map{|s| content_tag('li', s)}.join("\n").html_safe) | |
else | |
items.map{|s| "* #{s}"}.join("\n") | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment