def filter_options
      page_num = @options.delete(:page)
      per_page_num = @options.delete(:per_page)
      if (page_num || per_page_num)
        @options[:limit] = limits = (per_page_num || 20).to_i
        @options[:skip] = (page_num || 1).to_i * limits - limits
      end
    end
def filter_options
      page_num = @options.delete(:page)
      per_page_num = @options.delete(:per_page)
      if (page_num || per_page_num)
        @options[:limit] = limits = (per_page_num || 20).to_i
        @options[:skip] = (page_num || 1).to_i * limits - limits
      end
    end
Filters the unused options out of the options +Hash+. Currently this
 takes into account the "page" and "per_page" options that would be passed
 in if using will_paginate.

 Example:

 Given a criteria with a selector of { :page => 1, :per_page => 40 }

 <tt>criteria.filter_options</tt> # selector: { :skip => 0, :limit => 40 }