Skip to content
This repository was archived by the owner on Apr 13, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
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
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,20 @@ client.project.stories(fields: ':default,comments(:default,person)') # Eage
story.comments(fields: ':default,person') # Eagerly get comments and the person that made the comment for a story
```

## Warning

Direct mutation of an attribute value skips coercion and dirty tracking. Please use direct assignment or the specialized add_* methods to get expected behavior.
https://github.com/solnic/virtus#important-note-about-member-coercions

This will cause coercion and dirty tracking to be bypassed and the new label will not be saved.
```ruby
story = project.story(847762630)

label = TrackerApi::Resources::Label.new(name: 'Special Snowflake')
story.labels << label
story.save
```

## TODO

- Add missing resources and endpoints
Expand Down
4 changes: 2 additions & 2 deletions lib/tracker_api/resources/activity.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ class Activity
attribute :project_version, Integer
attribute :message, String
attribute :highlight, String
attribute :changes, Shared::Collection[Change]
attribute :primary_resources, Shared::Collection[PrimaryResource]
attribute :changes, [Change]
attribute :primary_resources, [PrimaryResource]
attribute :project, Project
attribute :performed_by, Person
attribute :occurred_at, DateTime
Expand Down
4 changes: 2 additions & 2 deletions lib/tracker_api/resources/comment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ class Comment
attribute :person_id, Integer
attribute :created_at, DateTime
attribute :updated_at, DateTime
attribute :file_attachment_ids, Shared::Collection[Integer]
attribute :google_attachment_ids, Shared::Collection[Integer]
attribute :file_attachment_ids, [Integer]
attribute :google_attachment_ids, [Integer]
attribute :commit_identifier, String
attribute :commit_type, String
attribute :kind, String
Expand Down
8 changes: 4 additions & 4 deletions lib/tracker_api/resources/epic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ class Epic

attribute :client

attribute :comment_ids, Shared::Collection[Integer]
attribute :comments, Shared::Collection[Comment]
attribute :comment_ids, [Integer]
attribute :comments, [Comment]
attribute :created_at, DateTime
attribute :description, String
attribute :follower_ids, Shared::Collection[Integer]
attribute :followers, Shared::Collection[Person]
attribute :follower_ids, [Integer]
attribute :followers, [Person]
attribute :kind, String
attribute :label, Label
attribute :label_id, Integer
Expand Down
4 changes: 2 additions & 2 deletions lib/tracker_api/resources/iteration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ class Iteration
attribute :planned, Boolean
attribute :project_id, Integer
attribute :start, DateTime
attribute :stories, Shared::Collection[Story]
attribute :story_ids, Shared::Collection[Integer]
attribute :stories, [Story]
attribute :story_ids, [Integer]
attribute :team_strength, Float

def stories=(data)
Expand Down
6 changes: 3 additions & 3 deletions lib/tracker_api/resources/me.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ class Me
attribute :time_zone, TimeZone
attribute :api_token, String
attribute :has_google_identity, Boolean
attribute :project_ids, Shared::Collection[Integer]
attribute :projects, Shared::Collection[MembershipSummary]
attribute :workspace_ids, Shared::Collection[Integer]
attribute :project_ids, [Integer]
attribute :projects, [MembershipSummary]
attribute :workspace_ids, [Integer]
attribute :email, String
attribute :receives_in_app_notifications, Boolean
attribute :kind, String
Expand Down
8 changes: 4 additions & 4 deletions lib/tracker_api/resources/project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ class Project
attribute :enable_incoming_emails, Boolean
attribute :enable_planned_mode, Boolean
attribute :enable_tasks, Boolean
attribute :epic_ids, Shared::Collection[Integer]
attribute :epics, Shared::Collection[Epic]
attribute :epic_ids, [Integer]
attribute :epics, [Epic]
attribute :has_google_domain, Boolean
attribute :initial_velocity, Integer
attribute :iteration_length, Integer
attribute :kind, String
attribute :label_ids, Shared::Collection[Integer]
attribute :labels, Shared::Collection[Label]
attribute :label_ids, [Integer]
attribute :labels, [Label]
attribute :name, String
attribute :number_of_done_iterations_to_show, Integer
attribute :point_scale, String
Expand Down
17 changes: 0 additions & 17 deletions lib/tracker_api/resources/shared/collection.rb

This file was deleted.

20 changes: 10 additions & 10 deletions lib/tracker_api/resources/story.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,32 @@ class Story
attribute :client

attribute :accepted_at, DateTime
attribute :comment_ids, Shared::Collection[Integer]
attribute :comments, Shared::Collection[Comment]
attribute :comment_ids, [Integer]
attribute :comments, [Comment]
attribute :created_at, DateTime
attribute :current_state, String # (accepted, delivered, finished, started, rejected, planned, unstarted, unscheduled)
attribute :deadline, DateTime
attribute :description, String
attribute :estimate, Float
attribute :external_id, String
attribute :follower_ids, Shared::Collection[Integer]
attribute :followers, Shared::Collection[Person]
attribute :follower_ids, [Integer]
attribute :followers, [Person]
attribute :integration_id, Integer
attribute :kind, String
attribute :label_ids, Shared::Collection[Integer]
attribute :labels, Shared::Collection[Label]
attribute :label_ids, [Integer]
attribute :labels, [Label]
attribute :name, String
attribute :owned_by_id, Integer # deprecated!
attribute :owned_by, Person
attribute :owner_ids, Shared::Collection[Integer]
attribute :owners, Shared::Collection[Person]
attribute :owner_ids, [Integer]
attribute :owners, [Person]
attribute :planned_iteration_number, Integer
attribute :project_id, Integer
attribute :requested_by, Person
attribute :requested_by_id, Integer
attribute :story_type, String # (feature, bug, chore, release)
attribute :task_ids, Shared::Collection[Integer]
attribute :tasks, Shared::Collection[Task]
attribute :task_ids, [Integer]
attribute :tasks, [Task]
attribute :updated_at, DateTime
attribute :url, String

Expand Down