def calculate_total_records query
      # Remove those keys from the query
      query.delete :page
      query.delete :limit
      query.delete :offset
      collection = new_collection scoped_query( query )
      collection.count.to_i
    end
def calculate_total_records query
      # Remove those keys from the query
      query.delete :page
      query.delete :limit
      query.delete :offset
      collection = new_collection scoped_query( query )
      collection.count.to_i
    end
Calculate total records

 @param [Hash] query
 @return [Integer]