Created
February 10, 2016 16:13
-
-
Save Mariusio/3702858fb2db2d0d0d7f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
import DS from 'ember-data'; | |
import { | |
validator, buildValidations | |
} | |
from 'ember-cp-validations'; | |
const Validations = buildValidations({ | |
name: validator('presence', true) | |
}); | |
export default DS.Model.extend(Validations, { | |
visualizations: DS.hasMany('visualization', {polymorphic: true}), | |
selectedVisualization: Ember.computed('visualizations', function() { | |
return this.get('visualizations').filterBy('recommendation', false).filterBy('active', true).get('firstObject'); | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment