You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I stumble on a case where I did not understand why my model.set called with {parse: true} did not call the parse method. I was very surprise to discover that parse must be called manually before a model.set whereas an option {parse: true} is enough for Collection.
Why Collection automatically parse inside the set when option parse is true, whereas Model does the parse outside the set ? Model fetch/save/constructor do call the parse method with options.parse on true, set is really the only method with a weird behaviour. Is there a good reason?
The text was updated successfully, but these errors were encountered:
I looked into this, and I agree there is an inconsistency here. I have not looked deeply into the reason for it, but it might very well be found in the chain of reversions mentioned in #3758. I suspect this is a subissue of #4266.
I think I also agree that Model.set should listen to the parse option like Collection.set. However, action should be taken only with extreme care and a coherent plan.
jgonggrijp
changed the title
Question about model#parse
Model.set does not call Model.parse, unlike Collection.set
Jul 27, 2023
I stumble on a case where I did not understand why my
model.set
called with{parse: true}
did not call theparse
method. I was very surprise to discover thatparse
must be called manually before amodel.set
whereas an option{parse: true}
is enough for Collection.Why Collection automatically parse inside the set when option
parse
is true, whereas Model does the parse outside the set ? Model fetch/save/constructor do call the parse method with options.parse on true,set
is really the only method with a weird behaviour. Is there a good reason?The text was updated successfully, but these errors were encountered: