Convert RB.Review to Backbone.js
Review Request #3990 — Created March 22, 2013 and submitted — Latest diff uploaded
Convert RB.Review to Backbone.js This change converts RB.Review to Backbone.js. This is a little bit more complicated than one might expect because of the way draft reviews are handled. The reviews.js code which handles pending reviews always creates review objects without an ID, which means they think that they're "new". We then fetch a special /draft/ resource which will redirect to an existing draft. This logic is encapsulated in a "DraftReview" object. If we try to fetch the existing draft and it fails, DraftReview will then fall back on the normal BaseResource implementations and create a new review object on the server when it goes to save().
Played around a fair bit creating draft reviews, adding comments, saving them, and publishing or discarding the resulting reviews. Also verified the quick "ship it" review functionality.