lib/tracker_api/resources/review.rb in tracker_api-1.11.0 vs lib/tracker_api/resources/review.rb in tracker_api-1.12.0
- old
+ new
@@ -5,15 +5,31 @@
attribute :client
attribute :id, Integer
attribute :story_id, Integer
+ attribute :project_id, Integer
attribute :review_type_id, Integer
attribute :reviewer_id, Integer
attribute :status, String # (unstarted, in_review, pass, revise)
attribute :created_at, DateTime
attribute :updated_at, DateTime
attribute :kind, String
attribute :review_type, ReviewType
+
+ class UpdateRepresenter < Representable::Decorator
+ include Representable::JSON
+
+ property :id
+ property :review_type_id
+ property :reviewer_id
+ property :status
+ end
+
+ def save
+ raise ArgumentError, 'Cannot update a review with an unknown story_id.' if story_id.nil?
+
+ Endpoints::Review.new(client).update(self, UpdateRepresenter.new(Review.new(dirty_attributes)))
+ end
end
end
-end
\ No newline at end of file
+end