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

[RFR] Preload references in refrenced_list entries #688

Merged
merged 3 commits into from
Sep 17, 2015

Conversation

fzaninotto
Copy link
Member

  • Implement the feature
  • Refactor the routing for more readbility
  • make tests pass

Closes #637, #383

@fzaninotto fzaninotto changed the title [WIP] Preload references in refrenced_list entries [RFR] Preload references in refrenced_list entries Sep 16, 2015
@fzaninotto
Copy link
Member Author

Switching to RFR

const identifierName = scope.targetEntity.identifier().name()
scope.referencedEntry = scope.datastore()
.getEntries(scope.targetEntity.uniqueId + '_values')
.filter(entry => entry.values[identifierName] == value)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

===

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming that the APIs we fetch are consistent (i.e. that the type of comment.post_id is the same as the type of post.id) is pretty brave, but I think we'd rather be tolerant to ease compatibility. So e.g. when comment.post_id is '1' and post.id is 1, the current code works.

@jpetitcolas
Copy link
Contributor

👍

fzaninotto added a commit that referenced this pull request Sep 17, 2015
[RFR] Preload references in refrenced_list entries
@fzaninotto fzaninotto merged commit 8bb1e36 into master Sep 17, 2015
@fzaninotto fzaninotto deleted the referenced_list_references branch September 17, 2015 07:24
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