title: In rails_admin, how can I filter on an association count?
body: <p>Using rails_admin 0.6.2, I've added a custom field for a count of associated objects. For example, in a list of blog posts, show how many comments each has.</p>
  
  <pre><code>config.model Post do
    list do
      field :id
      field :comment_count, :integer do
        def value
          bindings[:object].comment.count
        end
        filterable true
      end
  </code></pre>
  
  <p>I want to be able to filter based on this number - show me posts with 0 comments, between 1 and 10, etc.</p>
  
  <p>Right now there's no way it could do that, as this count is just created with an N+1 query; every time it lists a post, it queries for the comment count. I would need it to add a <code>WHERE</code> condition to its earlier query for the posts.</p>