title: Sequelize - validate based on associations
body: <p>I'm using PostgreSQL and Sequelize for my project.</p>
  
  <p>I have 2 models, 1 is <code>Event</code> which, among other fields, has <code>questions</code> field, which is an array of strings, and also I have another model, <code>Application</code>, which belongs to <code>Event</code> model and has, among other fields, the field <code>answers</code>, which is the array of strings as well.</p>
  
  <p>What I need to implement is a custom validator which will make <code>Application</code> model invalid if the <code>questions</code> amount on <code>Application</code> is not the same as the amount of <code>answers</code> in <code>Event</code> it belongs to. It should work both when creating and updating an <code>Application</code> model.</p>
  
  <p>For now I've implemented it as a check in the endpoint handler, but this does not seem to me as a good solution, as I want to move each piece of the model's logic to the model itself instead of handling it in the controller.</p>
  
  <p>So, my question is: is there a way to implement it the way I want it?</p>