epf
epf copied to clipboard
Reserved model attribute names
Hi Gordon
It seems that Epf have some reserved attribute names used internally on Ep.Model. For example, while migrating from Ember Data, I have a model with an attribute 'type'. It causes a "Call to underscore on 'undefined' " error, and take me a few minutes to figure it out. I have just renamed my attribute to something else than 'type', and all turns good.
Could you confirm that, and eventually document those reserved words ? I think about 'id', 'clientId', 'type', 'session', etc.
Cheers Rémy
I can confirm there are some reserved attribute names. Off the top of my head they would be: rev
, id
, clientId
, clientRev
, and type
.
I will definitely document all of these and will leave this open to address that.
I don't want to complain, I think epf is a great library. But it would be neat if type
, which is a common attribute, could be moved to _type
or similar.
I know Ember Data switched from reference
to _reference
for the same reason.
I'd agree with @sandstrom. This is trivial to workaround by just mapping the attributes on the adapter but I think it will likely trip up a lot of new users. rev
and clientRev
probably aren't real common, but clientId
and especially type
are likely to show up quite often. Would there be any issues with just moving these to the underscored versions?
I also agree with @sandstrom. Would to use my type
properties again.