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

Add handleFindOne method #50

Merged
merged 1 commit into from
Jan 14, 2015
Merged

Add handleFindOne method #50

merged 1 commit into from
Jan 14, 2015

Conversation

Marthyn
Copy link
Contributor

@Marthyn Marthyn commented Jan 14, 2015

to handle get requests with a specific id.

like

/api/v1/profiles/1

will return a record with id 1.

@danielspaniel
Copy link
Collaborator

@Marthyn .. can you give me use case for the handleFindOne .. it's interesting because I think I used to have that method, but I took it out a long time ago because I thought people could do:

FactoryGuy.make('user');
store.find('user', user.id).then(function(user) { // blah });

for this case.

@Marthyn
Copy link
Contributor Author

Marthyn commented Jan 14, 2015

True, but for example a reload on that object will still trigger an api request. I found in our app that even though we created the object with factoryguy there were still requests occurring, which we used to catch with pretender but we want to switch.

danielspaniel added a commit that referenced this pull request Jan 14, 2015
Add handleFindOne method
@danielspaniel danielspaniel merged commit 7d6414d into adopted-ember-addons:master Jan 14, 2015
@danielspaniel
Copy link
Collaborator

Oh boy .. totally forgot about reload .. got it.

@danielspaniel
Copy link
Collaborator

Are you using bower? If so you can get this code by updating since its now in master branch. If not (using gem) let me know and I will make new release version.

@danielspaniel
Copy link
Collaborator

@Marthyn .. and thanks for updating the readme documentation ( almost no one does that )

@Marthyn
Copy link
Contributor Author

Marthyn commented Jan 14, 2015

We're using the gem :)

@danielspaniel
Copy link
Collaborator

v0.9.4 gem is now ready

@Marthyn
Copy link
Contributor Author

Marthyn commented Jan 14, 2015

Thanks! Another use case i found btw is this:

self.transitionToRoute('chapter', self.get('model.id'));

you transition to the id of an object, instead of to the object itself. So it forces a reload.

@danielspaniel
Copy link
Collaborator

Interesting .. I have never done that in a transition .. only passed model .. good to know.

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