Hi,
I have a model class that extends Core.data.Model and contains some fields that use dataSource. For this example I have a field called id that has a dataSource of Id.
I create an instance of the model (passing an object that contains an Id property into the constructor). The resulting model has a data property containing Id, as was passed to it originally, and the model itself has a property for id which contains the same value.
If this model is in a store, the toJSON method returns the Id property for the model, rather than the id property, which is not what I expect.
Also, the 'get' function can fetch values for both id and Id. I'd expect it to only fetch a value for id ( get('Id') should be null at this point I think).
My expectation was that the data property would contain the 'id' property, and the 'Id' property would only exist in originalData. I'm especially surprised by the behaviour of toJSON!
Am I misunderstanding dataSource or is it not working properly?
Thanks