Skip to content

Avoid loading belongsTo relations with falsey ids#51

Closed
robertdp wants to merge 1 commit into
js-data:masterfrom
robertdp:master
Closed

Avoid loading belongsTo relations with falsey ids#51
robertdp wants to merge 1 commit into
js-data:masterfrom
robertdp:master

Conversation

@robertdp

Copy link
Copy Markdown

No description provided.

@jmdobry

jmdobry commented Jan 18, 2016

Copy link
Copy Markdown
Member

Should it be a falsey check? Or check for undefined instead?

@jmdobry

jmdobry commented Jan 18, 2016

Copy link
Copy Markdown
Member

Also, I think pull requests are supposed to go to the develop branch.

@robertdp

Copy link
Copy Markdown
Author

With SQL, local keys for optional relations will most likely be null, not undefined, which results in the query:

SELECT * FROM table WHERE id = ''

pull requests are supposed to go to the develop branch

Ah, okay. I can make that change if necessary.

@robertdp

Copy link
Copy Markdown
Author

Also, the falsey check is already being used for the other relation types, just not belongsTo. Which is why only optional belongsTo relations are causing Not Found! errors to be thrown unnecessarily all over my app.

@robertdp

Copy link
Copy Markdown
Author

Moved to #52

@robertdp robertdp closed this Jan 18, 2016
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

Successfully merging this pull request may close these issues.

2 participants