restpack-resource 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/lib/restpack-resource/service.rb +2 -0
- data/lib/restpack-resource/version.rb +1 -1
- metadata +1 -1
data/Gemfile.lock
CHANGED
@@ -4,12 +4,14 @@ module RestPack
|
|
4
4
|
module Service
|
5
5
|
|
6
6
|
def paged_resource(klass, params, options = {})
|
7
|
+
p "paged_resource: params: #{params}"
|
7
8
|
options[:page] ||= params[:page].to_i if params[:page]
|
8
9
|
options[:includes] ||= extract_includes_from_params(params) unless params[:includes].nil?
|
9
10
|
options[:sort_by] ||= params[:sort_by].to_sym if params[:sort_by]
|
10
11
|
options[:sort_direction] ||= params[:sort_direction].to_sym if params[:sort_direction]
|
11
12
|
|
12
13
|
filters = extract_filters_from_params(klass, params)
|
14
|
+
p "paged_resource: filters: #{filters}"
|
13
15
|
options[:filters] ||= filters unless filters.empty?
|
14
16
|
|
15
17
|
klass.paged_resource(options)
|