Skip to content

Commit

Permalink
Update store.js, additionnal doc
Browse files Browse the repository at this point in the history
Added a use case for Store.find().

Update store.js, additionnal doc, modification concerning comments

(cherry picked from commit b151c50)
  • Loading branch information
gabriel-letarte authored and bmac committed Jul 17, 2015
1 parent 67bca57 commit 35c7cab
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions packages/ember-data/lib/system/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -1038,26 +1038,36 @@ Store = Service.extend({
language for all server-side queries, and then require all adapters to
implement them.
---
If you do something like this:
```javascript
store.query('person', { page: 1 });
```
The call made to the server, using a Rails backend, will look something like this:
```
Started GET "/api/v1/person?page=1"
Processing by Api::V1::PersonsController#index as HTML
Parameters: {"page"=>"1"}
Parameters: { "page"=>"1" }
```
---
If you do something like this:
```javascript
store.query('person', {ids: [1, 2, 3]});
store.query('person', { ids: [1, 2, 3] });
```
The call to the server, using a Rails backend, will look something like this:
```
Started GET "/api/v1/person?ids%5B%5D=1&ids%5B%5D=2&ids%5B%5D=3"
Processing by Api::V1::PersonsController#index as HTML
Parameters: {"ids"=>["1", "2", "3"]}
Parameters: { "ids" => ["1", "2", "3"] }
```
This method returns a promise, which is resolved with a `RecordArray`
Expand Down

0 comments on commit 35c7cab

Please sign in to comment.