def limit options = {}
      # Remove this key if we come from limit_page method.
      page = options.delete :page
      query = options.dup
      collection = new_collection scoped_query( options = {
        :limit => options[:limit],
        :offset => options[:offset],
        :order => [options[:order]]
      }.merge( query ) )
      options.merge! :count => calculate_total_records( query ), :page => page
      collection.paginator = DataMapper::Paginator::Main.new options
      collection
    end
def limit options = {}
      # Remove this key if we come from limit_page method.
      page = options.delete :page
      query = options.dup
      collection = new_collection scoped_query( options = {
        :limit => options[:limit],
        :offset => options[:offset],
        :order => [options[:order]]
      }.merge( query ) )
      options.merge! :count => calculate_total_records( query ), :page => page
      collection.paginator = DataMapper::Paginator::Main.new options
      collection
    end
Limit results.

 @param [Hash] options
 @return [Collection]