Skip to content

Commit

Permalink
fix some of the ember/use-ember-data-rfc-395-imports ignored rules
Browse files Browse the repository at this point in the history
  • Loading branch information
mansona committed Dec 18, 2020
1 parent 1598294 commit dfe4c1c
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 33 deletions.
6 changes: 3 additions & 3 deletions addon/adapters/application.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* eslint-disable ember/use-ember-data-rfc-395-imports, ember/require-computed-property-dependencies, ember/no-get */
import DS from 'ember-data';
/* eslint-disable ember/require-computed-property-dependencies, ember/no-get */
import JSONAPIAdapter from '@ember-data/adapter/json-api';
import { computed } from '@ember/object';
import { inject as service } from '@ember/service';

export default DS.JSONAPIAdapter.extend({
export default JSONAPIAdapter.extend({
fastboot: service(),

host: computed('fastboot.isFastBoot', function() {
Expand Down
27 changes: 13 additions & 14 deletions app/models/author.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
/* eslint-disable ember/use-ember-data-rfc-395-imports */
import DS from 'ember-data';
import Model, { attr, hasMany } from '@ember-data/model';

export default DS.Model.extend({
name: DS.attr('string'),
image: DS.attr('string'),
coverImage: DS.attr('string'),
coverMeta: DS.attr(),
content: DS.attr('string'),
html: DS.attr(),
website: DS.attr('string'),
twitter: DS.attr('string'),
facebook: DS.attr('string'),
location: DS.attr('string'),
export default Model.extend({
name: attr('string'),
image: attr('string'),
coverImage: attr('string'),
coverMeta: attr(),
content: attr('string'),
html: attr(),
website: attr('string'),
twitter: attr('string'),
facebook: attr('string'),
location: attr('string'),

posts: DS.hasMany('content'),
posts: hasMany('content'),
});
32 changes: 16 additions & 16 deletions app/models/content.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
/* eslint-disable ember/use-ember-data-rfc-395-imports, ember/require-computed-macros, ember/no-get */
import DS from 'ember-data';
/* eslint-disable ember/require-computed-macros, ember/no-get */
import Model, { attr, hasMany } from '@ember-data/model';
import { get, computed } from '@ember/object';

import { deprecate } from '@ember/application/deprecations';

export default DS.Model.extend({
title: DS.attr('string'),
canonical: DS.attr(),
content: DS.attr('string'),
excerpt: DS.attr(),
html: DS.attr('string'),
export default Model.extend({
title: attr('string'),
canonical: attr(),
content: attr('string'),
excerpt: attr(),
html: attr('string'),

image: DS.attr('string'),
imageMeta: DS.attr(),
featured: DS.attr('boolean'),
status: DS.attr('string'),
date: DS.attr('date'),
tags: DS.hasMany('tag'),
image: attr('string'),
imageMeta: attr(),
featured: attr('boolean'),
status: attr('string'),
date: attr('date'),
tags: hasMany('tag'),

_primaryTagId: DS.attr(),
_primaryTagId: attr(),
primaryTag: computed('tags.[]', '_primaryTagId', function() {
return this.get('tags').findBy('id', this.get('_primaryTagId'));
}),

authors: DS.hasMany('author'),
authors: hasMany('author'),

author: computed('authors.[]', function() {
deprecate(`"author" is deprecated in the content model. You must use "authors" now in your templates.`, false, {
Expand Down

0 comments on commit dfe4c1c

Please sign in to comment.