title: YII2 exists validator with filter
body: <p>The rules for my model are shown below</p>
  
  <pre><code> public function rules()
  {
      return [
          ['default', 'boolean'],
          ['default', 'exist', 'targetAttribute' =&gt; 'default', 'filter' =&gt; ['default' =&gt; 1], 'message' =&gt; 'Cock'],
          ['length', 'integer'],
          ['length', 'unique'],
      ];
  }
  </code></pre>
  
  <p>I'm trying to ensure that only a single record can have the model attribute 'default' set to 'true'. They can all be false, but no more than one can be set to true if that makes sense.</p>
  
  <p>What am I doing wrong here ?</p>
  
  <p>Thanks</p>