dobtco/procure-io

View on GitHub
app/assets/javascripts/backbone/collections/response_field_list.js.coffee

Summary

Maintainability
Test Coverage
ProcureIo.Backbone.ResponseFieldList = Backbone.Collection.extend
  model: Backbone.DeepModel

  nextSortOrder: ->
    biggest = @.max((r) -> r.attributes.sort_order)

    if biggest.attributes
      biggest.attributes.sort_order + 1
    else
      1