mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-22 22:06:50 +00:00
Modified some code and removed unnecessary code from the ember and json api doc (#1852)
* modified some code and removed unnecessary code from the ember abd json api doc * using es6 imports
This commit is contained in:
parent
aa4d89ab47
commit
37a17723cf
@ -49,8 +49,10 @@ require 'active_model_serializers/register_jsonapi_renderer'
|
||||
|
||||
```javascript
|
||||
// app/adapters/application.js
|
||||
import Ember from 'ember';
|
||||
import DS from 'ember-data';
|
||||
import ENV from "../config/environment";
|
||||
const { underscore, pluralize } = Ember.String;
|
||||
|
||||
export default DS.JSONAPIAdapter.extend({
|
||||
namespace: 'api',
|
||||
@ -61,8 +63,8 @@ export default DS.JSONAPIAdapter.extend({
|
||||
|
||||
// allows the multiword paths in urls to be underscored
|
||||
pathForType: function(type) {
|
||||
let underscored = Ember.String.underscore(type);
|
||||
return Ember.String.pluralize(underscored);
|
||||
let underscored = underscore(type);
|
||||
return pluralize(underscored);
|
||||
},
|
||||
|
||||
// allows queries to be sent along with a findRecord
|
||||
|
||||
Loading…
Reference in New Issue
Block a user