Skip to content

Data wont render solution #212

Description

@shireen-bean

Page would not render data for profile.

Routes were set up correctly but this was the model:

export default DS.Model.extend({
  given_name: DS.attr('string'),
  user_id: DS.belongsTo('user'),
  level: DS.attr('integer'),
  favorites: DS.hasMany('favorite'),
  schedules: DS.hasMany('schedule'),
});

Errors Thrown:

vendor.js:42222 TypeError: Cannot read property 'some' of undefined
message: "No model was found for 'favorite'", name: "Error"…}
message: "Assertion Failed: Unable to find transform for 'integer'", name: "Error"…}

Solution Part 1:
You can't insert into a model a property DS.hasMany if that property does not yet have a model defined somewhere in your ember client.

Solution Part 2;
DS.attr('number')
Not integer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions