ENH: Collection filterings (#42)

Fixes #21
Fixes #28
Fixes #34
This commit is contained in:
Matthew Ryan Dillon 2017-11-10 11:18:33 -07:00 committed by GitHub
parent 695eb65806
commit 17651e071e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 296 additions and 8 deletions

11
app/models/region.js Normal file
View file

@ -0,0 +1,11 @@
import DS from 'ember-data';
const { Model, attr, hasMany } = DS;
export default Model.extend({
name: attr('string'),
code: attr('string'),
sortOrder: attr('number'),
site: hasMany('site'),
});

13
app/models/site.js Normal file
View file

@ -0,0 +1,13 @@
import DS from 'ember-data';
const { Model, attr, hasMany, belongsTo } = DS;
export default Model.extend({
name: attr('string'),
code: attr('string'),
description: attr('string'),
sortOrder: attr('number'),
region: belongsTo('region'),
studyLocation: hasMany('study-location'),
});

View file

@ -1,6 +1,6 @@
import DS from 'ember-data';
const { Model, attr } = DS;
const { Model, attr, belongsTo } = DS;
export default Model.extend({
name: attr('string'),
@ -10,4 +10,6 @@ export default Model.extend({
collectingLocation: attr('string'),
description: attr('string'),
sortOrder: attr('number'),
site: belongsTo('site'),
});