Skip to content

attribute "factory' not defined on model 'Foo'. warning, despite transformFixtureDataFn #73

@skinofstars

Description

@skinofstars

Hey, non breaking bug here.

I'm using a dummy data value so I can know when to load in a default model. However, even if I delete the key, it's still returning the error:

attribute "factory' not defined on model 'Foo'. warning, despite using transformFixtureDataFn to remove it.

i.e.

fixtures:
  - model: Foo
    data:
      factory: foo
transformFixtureDataFn: function (data) {
  if (data.factory) {
    data = require(`${ data.factory }.js`))(data);
    delete(data.factory);
  }
  return data;
}

So, like, I don't really think it should even care about extra values.

Otherwise, it's non-breaking, but it's just a bit annoying.

Also, there's a quote '"+'" type mismatch in this console:

console.warn('attribute "' + key +"' not defined on model '" + Model.name + "'.");

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions