You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds a fixture-level flag to disable the user of setter methods. This is a necessary feature if your model's setter methods us instance methods other than simple this.setDataValue.
The new flag will be called ignoreSet or something like:
matmar10
changed the title
Use of instance methods in setter methods breaks import
Add flag to suppress usage of use of property setter methods in case they use instance methods [feedback wanted]
Apr 22, 2019
Proposed Feature
Adds a fixture-level flag to disable the user of setter methods. This is a necessary feature if your model's setter methods us instance methods other than simple
this.setDataValue
.The new flag will be called
ignoreSet
or something like:ignoreSetter
ignoreSetters
ignorePropertySetter
ignorePropertySetters
Usage
Other Thoughts
Considered putting this under an
options
object as:But so far there are no other sequelize-fixtures specific options (the options are pass-through options for sequelize
build
/create
methods only.Background
If you use property setters, this library attempts to feed values from fixtures into them in case there is some coercion or formatting, etc.
The Problem
This library calls the setters in a simulated way, without a real object instance.
Steps to reproduce
set
method using any instance method inside (e.g.this.previous
or anything exceptthis.setDataValue
).Example:
Actual behavior
Expected behavior: using defined instance methods should not fail
The text was updated successfully, but these errors were encountered: