title: Rails routes with constraints
body: <p>I'm trying to catch UTF-8 URL. Normally, using constraints this works well. For the URL: <code>/international-delight-iced-coffee/</code> the route works:</p>
  <pre><code>match &quot;:post_name&quot;, :constraints =&gt; { :post_name =&gt; /.+/}}
  </code></pre>
  <p>All is well here. Where it fails is when I need to use advanced constraints:</p>
  <pre><code>match &quot;:post_name&quot;, :constraints =&gt; Post.new
  
  # inside Post.rb
  self.matches?(request)
    puts &quot;&gt;&gt;&gt;&gt; Arrived at matches!&quot;
    Post.find_by_name(request.path_parameters[:post_name])
  end
  </code></pre>
  <p><code>self.matches</code> never gets called. Any idea how to make the constraint catch?</p>