/**
 * Collection of draft documents that the user has approval rights over.
 */
var ApprovalsCollection = Backbone.Collection.extend({
	model: ApprovalsModel,
	url: '/intranet/rest/documents/folder/0/documents/?to_approve=1',
	is_loaded: false,

	load: function ()
	{
		this.is_loaded = true;
		this.fetch({reset: 1});
	},

	isCheckedOut: function (doc_id)
	{
		var res = this.find(function (co) { return co.get('doc_id') == doc_id; } );
		return res ? true : false;
	}

});
