Closed jessehouchins closed 10 years ago
Note: if anyone implements this, DO NOT let the silent option through to the set... it prevents associations from being updated.
Great point. {silent: true}
is generally troublesome in my experience.
Thanks for reporting! Fixed in 0c6d42c.
you forgot to omit the silent option... it gets set automatically during collection initialization and can blow shit up if the models being initialized with the collection already exist in the all
collection...
Ah, I thought you were referring to users of silent
, not omitting it here... :neutral_face:
You're right, but I don't think we can prevent it regardless. If we omit silent
then we subvert the users intent to silence events. If we let it pass we prevent associations from functioning correctly.
Also, why would you pass silent: true
to Model.create
(out of curiosity)?
The backbone collection constructor does it automatically: https://github.com/jashkenas/backbone/blob/master/backbone.js#L632
Also, not allowing silent through just keeps current functionality in that respect since it wasn't getting through before anyway.
Oh man, I didn't even think about the silent
option from reset
as I think it's intended for Collection#add
, not Model#set
. :unamused:
Not much way around it I suppose. Updated in bafa07e. Thanks again!
Model.create does not pass options when an existing model is found: https://github.com/pathable/supermodel/blob/master/supermodel.js#L479
Should be: