I used the generator to create an application to change & display my graph store content.
It's working quite fine, I can generate new resources and modify them without any problem... except on a specific resource. That resource sometimes appear with one (or more) "blank" belongsTo relation, even though both in the DB & the network tab, the linked resource is present.
I can change the link to another resource but as soon as I refresh, the cell will appear empty again.
As it doesn't mess with my data, it's not the biggest issue ever but I haven't been able to figure out where the problem was coming from on my own sooooo, here we are.
// Information
import Ember from 'ember';
import Model from 'ember-data/model';
import attr from 'ember-data/attr';
import { belongsTo, hasMany } from 'ember-data/relationships';
export default Model.extend({
// A string representation of this model, based on its attributes.
// This is what mu-cl-resources uses to search on, and how the model will be presented while editing relationships.
stringRep: Ember.computed.collect.apply(this,['id','timestamp', 'label', 'value']),
timestamp: attr('datetime'),
label: attr('string'),
value: attr('string'),
informationFor: belongsTo('subject', {inverse: "information" }),
informationType: belongsTo('information-type', {inverse: "typeFor" }),
informationOrigin: belongsTo('information-origin', {inverse: "originFor" }),
consents: hasMany('consent', {inverse: "consentFor" })
});
// Information-type
import Ember from 'ember';
import Model from 'ember-data/model';
import attr from 'ember-data/attr';
import { belongsTo } from 'ember-data/relationships';
export default Model.extend({
// A string representation of this model, based on its attributes.
// This is what mu-cl-resources uses to search on, and how the model will be presented while editing relationships.
stringRep: Ember.computed.collect.apply(this,['id','label', 'name', 'icon', 'tooltip', 'component']),
label: attr('string'),
name: attr('string'),
icon: attr('string'),
tooltip: attr('string'),
component: attr('string'),
typeFor: belongsTo('information', {inverse: "informationType" })
});
I used the generator to create an application to change & display my graph store content. It's working quite fine, I can generate new resources and modify them without any problem... except on a specific resource. That resource sometimes appear with one (or more) "blank" belongsTo relation, even though both in the DB & the network tab, the linked resource is present.
I can change the link to another resource but as soon as I refresh, the cell will appear empty again.
As it doesn't mess with my data, it's not the biggest issue ever but I haven't been able to figure out where the problem was coming from on my own sooooo, here we are.
I'll copy the required info down below.
Screenshots of the issue:
Resources model in domain.lisp:
Relations as defined in Ember app models:
Any help on this?