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

Attribute must not have the same name as model #10

Open
claaslange opened this issue Jul 1, 2014 · 0 comments
Open

Attribute must not have the same name as model #10

claaslange opened this issue Jul 1, 2014 · 0 comments

Comments

@claaslange
Copy link
Member

If an attribute of a model has the same name as the model itself, it will be an empty object when retrieved.

App.IdTag.where(phone: "0111123124").first (err, idTag) =>
    App.Logger.log "IdTag found, ",idTag

Output:

2014-07-01T07:49:57.387Z - info: IdTag found,
{ attributes:
   { id: 43,
     phone: '0111123124',
     userId: null,
     partnerId: 10,
     createdAt: Tue Jul 01 2014 09:46:50 GMT+0200 (CEST),
     updatedAt: Tue Jul 01 2014 09:46:50 GMT+0200 (CEST),
     idTag: {} },
  methods:
   [ 'decrement',
     'increment',
     'verifyAssociationsExist',
     'save',
     'eagerlyLoadedAssociations',
     'isNew',
     'attributeValues',
     'previousValues',
     'daoInstance' ] }

After renaming the idTag attribute to token the query works as intended.

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

No branches or pull requests

1 participant