Skip to content
This repository was archived by the owner on Apr 13, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions lib/tracker_api/resources/story.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class UpdateRepresenter < Representable::Decorator
property :deadline
property :requested_by_id
property :owner_ids, if: ->(_) { !owner_ids.blank? }
property :project_id

# Use render_empty: false to address: https://github.com/dashofcode/tracker_api/issues/110
# - The default value of the labels attribute in Resources::Story is an empty array.
Expand Down Expand Up @@ -165,6 +166,17 @@ def transitions(params = {})
end
end

# Returns the story's original ("undirtied") project_id
#
# @return Integer
def project_id
if dirty_attributes.key?(:project_id)
original_attributes[:project_id]
else
@project_id
end
end

# @param [Hash] params attributes to create the task with
# @return [Task] newly created Task
def create_task(params)
Expand Down