tracker_api/lib/tracker_api/resources/story.rb in v2gpti-1.2.3 vs tracker_api/lib/tracker_api/resources/story.rb in v2gpti-1.2.4
- old
+ new
@@ -76,15 +76,15 @@
Endpoints::Story.new(client).update(self, just_changes)
changes_applied
end
- # update labels.This method can also be used to remove labels.
- def add_labels(*new_labels)
+ # Add a new label to a story
+ def add_label(label)
raise ArgumentError, 'Can not update a story with an unknown project_id.' if project_id.nil?
- raise ArgumentError, 'Provide at lease one label name' if new_labels.empty?
+ raise ArgumentError, 'Provide at lease one label name' if label.empty?
- Endpoints::Story.new(client).update(self, {:labels => new_labels.map{|l| {:name => l.to_s}}})
+ Endpoints::Story.new(client).add_label(self, {:name => label.to_s})
changes_applied
end
# Add an existing attachment to the story