lib/query_helper.rb in query_helper-0.2.5 vs lib/query_helper.rb in query_helper-0.2.6
- old
+ new
@@ -34,11 +34,11 @@
@query = query.class < ActiveRecord::Relation ? query.to_sql : query
@model = query.class < ActiveRecord::Relation ? query.base_class : model
@bind_variables = bind_variables
@sql_filter = sql_filter
@sql_sort = sql_sort
- @page = page.to_i if page
- @per_page = per_page.to_i if per_page
+ @page = (page.to_i if page) || 1
+ @per_page = (per_page.to_i if per_page) || 100
@single_record = single_record
@associations = associations
@as_json_options = as_json_options
@custom_mappings = custom_mappings
@api_payload = api_payload