mirror of
https://github.com/dolphin-emu/redmine_webhook.git
synced 2026-01-31 01:15:19 +01:00
fix(IssueWrapper): remove CustomFieldWrapper and update CustomFieldValueWrapper
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user