Skip to content

Commit

Permalink
If params are passed to accessor then make new request.
Browse files Browse the repository at this point in the history
  • Loading branch information
forest committed Jul 22, 2015
1 parent f647c85 commit df1906c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/tracker_api/resources/story.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Story

attribute :accepted_at, DateTime
attribute :comment_ids, Array[Integer]
attribute :comments, Array[Comment]
attribute :comments, Array[Comment], :default => []
attribute :created_at, DateTime
attribute :current_state, String # (accepted, delivered, finished, started, rejected, planned, unstarted, unscheduled)
attribute :deadline, DateTime
Expand All @@ -19,19 +19,19 @@ class Story
attribute :integration_id, Integer
attribute :kind, String
attribute :label_ids, Array[Integer]
attribute :labels, Array[Label]
attribute :labels, Array[Label], :default => []
attribute :name, String
attribute :owned_by_id, Integer # deprecated!
attribute :owned_by, Person
attribute :owner_ids, Array[Integer]
attribute :owners, Array[Person]
attribute :owners, Array[Person], :default => []
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, Array[Integer]
attribute :tasks, Array[Task]
attribute :tasks, Array[Task], :default => []
attribute :updated_at, DateTime
attribute :url, String

Expand Down Expand Up @@ -72,7 +72,7 @@ def activity(params = {})
# @param [Hash] params
# @return [Array[Comment]]
def comments(params = {})
if @comments && @comments.any?
if params.blank? && @comments.any?
@comments
else
@comments = Endpoints::Comments.new(client).get(project_id, id, params)
Expand All @@ -84,7 +84,7 @@ def comments(params = {})
# @param [Hash] params
# @return [Array[Task]]
def tasks(params = {})
if @tasks && @tasks.any?
if params.blank? && @tasks.any?
@tasks
else
@tasks = Endpoints::Tasks.new(client).get(project_id, id, params)
Expand All @@ -96,7 +96,7 @@ def tasks(params = {})
# @param [Hash] params
# @return [Array[Person]]
def owners(params = {})
if @owners && @owners.any?
if params.blank? && @owners.any?
@owners
else
@owners = Endpoints::StoryOwners.new(client).get(project_id, id, params)
Expand Down

0 comments on commit df1906c

Please sign in to comment.