Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Expose buildURL suffix parameter in findQuery, filter #825

wants to merge 2 commits into from

3 participants


Exposes the suffix parameter of the buildURL function to allow it to be set via calls to the findQuery and filter functions. This allows API urls such as /people/search/ to be accessed, without the need to create a custom adapter to do so.


You should add some tests...


Please add some tests so that this can be merged!


Unfortunately, this ticket won't merge cleanly and no tests have been provided. If this is still desired, a new ticket should be opened. Be warned that @tomdale and @wycats are doing some revamping of the adapter API so it would be good to coordinate with them.

@wagenet wagenet closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 11, 2013
  1. Expose suffix parameter of buildURL function calls

    everwakeful authored
  2. Fixed incorrect comparison operator

    everwakeful authored
This page is out of date. Refresh to see the latest.
4 packages/ember-data/lib/adapters/rest_adapter.js
@@ -260,10 +260,10 @@ DS.RESTAdapter = DS.Adapter.extend({
- findQuery: function(store, type, query, recordArray) {
+ findQuery: function(store, type, query, recordArray, suffix) {
var root = this.rootForType(type);
- this.ajax(this.buildURL(root), "GET", {
+ this.ajax(this.buildURL(root, suffix), "GET", {
data: query,
success: function(json) {, function(){
13 packages/ember-data/lib/system/store.js
@@ -766,16 +766,17 @@ DS.Store = Ember.Object.extend(DS._Mappable, {
@param {Class} type
@param {Object} query an opaque query to be used by the adapter
+ @param {string} suffix an optional url suffix to be used by the adapter
@return {DS.AdapterPopulatedRecordArray}
- findQuery: function(type, query) {
+ findQuery: function(type, query, suffix) {
var array = DS.AdapterPopulatedRecordArray.create({ type: type, query: query, content: Ember.A([]), store: this });
var adapter = this.adapterForType(type);
Ember.assert("You tried to load a query but you have no adapter (for " + type + ")", adapter);
Ember.assert("You tried to load a query but your adapter does not implement `findQuery`", adapter.findQuery);
- adapter.findQuery(this, type, query, array);
+ adapter.findQuery(this, type, query, array, suffix);
return array;
@@ -876,14 +877,16 @@ DS.Store = Ember.Object.extend(DS._Mappable, {
data before loading it into the store.
@param {Class} type
+ @param {Object} query
@param {Function} filter
+ @param {string} suffix
@return {DS.FilteredRecordArray}
- filter: function(type, query, filter) {
+ filter: function(type, query, filter, suffix) {
// allow an optional server query
- if (arguments.length === 3) {
- this.findQuery(type, query);
+ if (arguments.length >= 3) {
+ this.findQuery(type, query, suffix);
} else if (arguments.length === 2) {
filter = query;
Something went wrong with that request. Please try again.