Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

deprecation warning on ember data models

Just updated to ember v1.12.0-beta.1 and ember-data v1.0.0-beta.16. I'm getting the following deprecation warning on the fields in my models:

DEPRECATION: Using the same function as getter and setter is deprecated. See http://emberjs.com/deprecations/v1.x/#toc_deprecate-using-the-same-function-as-getter-and-setter-in-computed-properties for more details.

The Ember inspector Deprecations view is pointing to all my models. So I basically get one deprecation error per line in my model. Here is an example model:

import DS from 'ember-data';

export default DS.Model.extend({
    userid: DS.attr('number'),
    unitid: DS.attr('number'),
    log: DS.attr('string'),
    name: DS.attr('string'),
    start_date: DS.attr('date'),
    end_date: DS.attr('date'),
    duration_mins: DS.attr('number')
});
like image 488
mkohram Avatar asked Mar 30 '15 22:03

mkohram


1 Answers

As @albertjan said this is a bug and there's already a fix. Upgrading to the latest version of Ember Data beta 17 or greater will resolve it.

Making this a community wiki answer so no-one misses the comment.

like image 187
4 revs, 2 users 69% Avatar answered Oct 16 '22 18:10

4 revs, 2 users 69%