Skip to content

Commit

Permalink
Merge pull request #275 from CvX/fix-deprecation
Browse files Browse the repository at this point in the history
Fix inflector deprecation
  • Loading branch information
fsmanuel authored Dec 8, 2017
2 parents 866e592 + c10c2fe commit 709bb27
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
7 changes: 3 additions & 4 deletions addon/adapters/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@ const {
get,
RSVP,
run,
Inflector,
typeOf,
isEmpty,
computed
} = Ember;

// Ember data ships with ember-inflector
const inflector = Inflector.inflector;
import { singularize, pluralize } from 'ember-inflector';

export default JSONAPIAdapter.extend(ImportExportMixin, {
_debug: false,
Expand Down Expand Up @@ -181,7 +180,7 @@ export default JSONAPIAdapter.extend(ImportExportMixin, {
});

if (query && query.filter) {
const serializer = this.store.serializerFor(inflector.singularize(type));
const serializer = this.store.serializerFor(singularize(type));

return records.filter((record) => {
return this._queryFilter(record, serializer, query.filter);
Expand Down Expand Up @@ -232,7 +231,7 @@ export default JSONAPIAdapter.extend(ImportExportMixin, {

// normalize type
if (key === 'type' && typeOf(queryValue) === 'string') {
queryValue = inflector.pluralize(queryValue);
queryValue = pluralize(queryValue);
}

// Attributes
Expand Down
1 change: 1 addition & 0 deletions config/ember-try.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-env node */
module.exports = {
useYarn: true,
scenarios: [
{
name: 'ember-lts-2.4',
Expand Down

0 comments on commit 709bb27

Please sign in to comment.