Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reserved model attribute names #32

Open
dogawaf opened this issue Jul 25, 2013 · 4 comments
Open

Reserved model attribute names #32

dogawaf opened this issue Jul 25, 2013 · 4 comments

Comments

@dogawaf
Copy link

dogawaf commented Jul 25, 2013

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

@ghempton
Copy link
Contributor

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.

@sandstrom
Copy link

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.

@jasonkriss
Copy link
Contributor

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?

@miguelcobain
Copy link

I also agree with @sandstrom. Would to use my type properties again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants