I'm looking for a tip. I got a Waterline model, which have to be "scanned" by a controller to perform an operation depending on each attribute's properties.
Let me show you
attributes: {
bar: {
model: "Baz",
MyCustomModule: {// should be ignored by Anchor's validation
foo: false
}
},
bar: {
type: "string",
unique: true,
MyCustomModule: {// should be ignored by Anchor's validation
foo: true
}
}
}
The property MyCustomModule triggers an error, not at my app's startup, but at the first request made to that model.
/some/path/node_modules/sails/node_module/anchor/lib/match/matchRule.js:37
throw new Error('Unknown rule: ' + ruleName);
^
Error: Unknown rule: MyCustomModule
at Object.matchRule (/some/path/node_modules/sails/node_modules/anchor/lib/match/matchRule.js:37:11)
at Anchor.to (/some/path/node_modules/sails/node_modules/anchor/index.js:76:45)
at /some/path/node_modules/sails/node_modules/waterline/lib/waterline/core/validations.js:188:31
....
Where this problem is really weird, it's because this method works perfectly on my local machine. It only triggers errors on my server, that I've just installed... Is that a configuration problem? Like a "Strict" behavior, or something?
Thanks
Alex
MyCustomModulein the wrong place. - galactocalypse