You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -4219,6 +4219,7 @@ function Resource(utils, options) {
4219
4219
* - `{string=}` - `endpoint` - The attribute that specifies the primary key for this resource. Default is the value of `name`.
4220
4220
* - `{string=}` - `baseUrl` - The url relative to which all AJAX requests will be made.
4221
4221
* - `{boolean=}` - `useClass` - Whether to use a wrapper class created from the ProperCase name of the resource. The wrapper will always be used for resources that have `methods` defined.
4222
+
* - `{function=}` - `defaultFilter` - Override the filtering used internally by `DS.filter` with you own function here.
4222
4223
* - `{*=}` - `meta` - A property reserved for developer use. This will never be used by the API.
4223
4224
* - `{object=}` - `methods` - If provided, items of this resource will be wrapped in a constructor function that is
4224
4225
* empty save for the attributes in this option which will be mixed in to the constructor function prototype. Enabling
@@ -4242,6 +4243,7 @@ function Resource(utils, options) {
4242
4243
*/
4243
4244
functiondefineResource(definition){
4244
4245
varIA=this.errors.IA;
4246
+
varDS=this;
4245
4247
4246
4248
if(this.utils.isString(definition)){
4247
4249
definition=definition.replace(/\s/gi,'');
@@ -4262,19 +4264,27 @@ function defineResource(definition) {
Copy file name to clipboardExpand all lines: src/datastore/sync_methods/defineResource.js
+46-14Lines changed: 46 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -51,6 +51,7 @@ function Resource(utils, options) {
51
51
* - `{string=}` - `endpoint` - The attribute that specifies the primary key for this resource. Default is the value of `name`.
52
52
* - `{string=}` - `baseUrl` - The url relative to which all AJAX requests will be made.
53
53
* - `{boolean=}` - `useClass` - Whether to use a wrapper class created from the ProperCase name of the resource. The wrapper will always be used for resources that have `methods` defined.
54
+
* - `{function=}` - `defaultFilter` - Override the filtering used internally by `DS.filter` with you own function here.
54
55
* - `{*=}` - `meta` - A property reserved for developer use. This will never be used by the API.
55
56
* - `{object=}` - `methods` - If provided, items of this resource will be wrapped in a constructor function that is
56
57
* empty save for the attributes in this option which will be mixed in to the constructor function prototype. Enabling
@@ -74,6 +75,7 @@ function Resource(utils, options) {
74
75
*/
75
76
functiondefineResource(definition){
76
77
varIA=this.errors.IA;
78
+
varDS=this;
77
79
78
80
if(this.utils.isString(definition)){
79
81
definition=definition.replace(/\s/gi,'');
@@ -94,19 +96,27 @@ function defineResource(definition) {
0 commit comments