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
Since there is no way to currently query based on a value and an associated value I figured I could create a scope; however, epilogue only appears to be able to take a scope name and no parameters.
Is this possible?
The text was updated successfully, but these errors were encountered:
As mentioned in the Sequelize documentation here http://docs.sequelizejs.com/en/latest/api/model/#scopeoptions-model
You can have scope functions with parameters.
e.g.
complexFunction: function(email, accessLevel) {
return {
where: {
email: {
$like: email
},
accesss_level {
$gte: accessLevel
}
}
}
}
then use it like
Model.scope({ method: ['complexFunction' '[email protected]', 42]}).findAll()
Since there is no way to currently query based on a value and an associated value I figured I could create a scope; however, epilogue only appears to be able to take a scope name and no parameters.
Is this possible?
The text was updated successfully, but these errors were encountered: