2011-11-29 13:58:19 +00:00
|
|
|
class Locomotive.Models.Membership extends Backbone.Model
|
|
|
|
|
|
|
|
toJSONForSave: ->
|
|
|
|
_.tap {}, (hash) =>
|
|
|
|
for key, value of @.toJSON()
|
2012-02-01 14:15:20 +00:00
|
|
|
hash[key] = value if _.include(['id', '_id', 'role', '_destroy'], key)
|
2011-11-29 13:58:19 +00:00
|
|
|
|
|
|
|
class Locomotive.Models.MembershipsCollection extends Backbone.Collection
|
|
|
|
|
|
|
|
model: Locomotive.Models.Membership
|
|
|
|
|
|
|
|
toJSONForSave: ->
|
|
|
|
@map (model) => model.toJSONForSave()
|