sequelize-fixtures
sequelize-fixtures copied to clipboard
attribute "factory' not defined on model 'Foo'. warning, despite transformFixtureDataFn
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:
https://github.com/domasx2/sequelize-fixtures/blob/b6dd2200d4e7fdaff0e45c6277d9ed6d92bc7c04/lib/loader.js#L224
Thanks
@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?