title: Custom ActiveAdmin filter for Date Range
body: <p>I need to create a custom ActiveAdmin filter for a Date Range which belongs to another resource. I want to filter a list of users by a date range of when they completed a survey. </p>
  
  <p>I've declared a custom filter in the ActiveAdmin DSL like so:</p>
  
  <pre><code>filter :by_date_completed, label: 'By Date Completed', as: :date_range
  </code></pre>
  
  <p>This makes me a nice date range in active admin to restrict my users by. All good. </p>
  
  <p>I haven't been able to find much documentation on how to do this but in my user model I've tried to create a ransacker to handle the filter.</p>
  
  <pre><code>ransacker :by_date_completed, {
      formatter: proc { |start_date, end_date|
  
          time_range = start_date..end_date
          users = User.joins(:surveys).where(surveys: { updated_at: time_range})
  
          users = users.map(&amp;:id)
          users.present? ? users : nil
          }, 
      callable: proc { |parent|
      parent.table[:id]
      }
  }  
  </code></pre>
  
  <p>But ActiveAdmin passes the date ranges to the filter one at a time and so I can't get a range to search by?</p>
  
  <p>What am I meant to do in this scenario? Am I going about the whole problem in the wrong way? </p>