1 2 3 4 5 6 7 8 9 10 11 12 13
define ['backbone'], (Backbone) -> class extends Backbone.Model idAttribute: 'key' mergeProperties: (properties) -> props = @get 'properties' props = properties.map (prop) -> data = _.findWhere props, key: prop.key _.extend prop, data @set 'properties', props