Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
skinofstars opened this issue Feb 14, 2017 · 1 comment
Labels

Comments

@skinofstars
Copy link

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

@skinofstars skinofstars changed the title attribute "foo' not defined on model 'Bar'. warning, despite transformFixtureDataFn attribute "factory' not defined on model 'Foo'. warning, despite transformFixtureDataFn Feb 14, 2017
@matmar10
Copy link
Collaborator

@skinofstars you can define any custom metadata you like under any property except data, such as:

- model: User
  # this works OK
  factory: foo 
  # so does this
  meta:
    foo: bar
  data:
    email: [email protected]

Does this help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants