So I'm trying to get acquainted with Railway.js, thus I'm making a small application, part of which involves email validation on the model. Now:
-Taken from db/schema.js-
var User = describe('User', function () {
property('email', String, { index : true });
property('password', String);
property('public_key', String);
});
-Taken from app/models/user.js-
User.validatesPresenceOf('email', 'password', 'public_key');
User.validatesFormatOf('email', ''); /* ARR HERE BE THE DRAGONS! */
So, I want to implement my own validation routine for emails, as I would like to check for existence of MX records, among other things, which regex can't solve. In any case, point is I can't see how to approach this, and the official docs aren't much help either.
Well, after actually thinking over it again, I realized that Railway.js uses JugglingDB, which lead me to check the repository. Well, the key was in JugglingDB's docs.