fix(IssueWrapper): remove CustomFieldWrapper and update CustomFieldValueWrapper

This commit is contained in:
Christian Orthmann
2019-01-25 13:58:18 +01:00
parent ebecc81fce
commit ed3179d3ab
3 changed files with 1 additions and 14 deletions

View File

@@ -6,6 +6,7 @@ class RedmineWebhook::CustomFieldValueWrapper
def to_hash
{
custom_field_id: @custom_field_value.custom_field_id,
custom_field_name: @custom_field_value.custom_field.name,
value: @custom_field_value.value
}
end

View File

@@ -1,13 +0,0 @@
class RedmineWebhook::CustomFieldWrapper
def initialize(custom_field)
@custom_field = custom_field
end
def to_hash
{
id: @custom_field.id,
name: @custom_field.name,
possible_values: @custom_field.possible_values
}
end
end

View File

@@ -20,7 +20,6 @@ module RedmineWebhook
:estimated_hours => @issue.estimated_hours,
:is_private => @issue.is_private,
:lock_version => @issue.lock_version,
:custom_fields => @issue.custom_fields.collect { |custom_field| RedmineWebhook::CustomFieldWrapper.new(custom_field).to_hash },
:custom_field_values => @issue.custom_field_values.collect { |value| RedmineWebhook::CustomFieldValueWrapper.new(value).to_hash },
:project => RedmineWebhook::ProjectWrapper.new(@issue.project).to_hash,
:status => RedmineWebhook::StatusWrapper.new(@issue.status).to_hash,