fetcha 0.1.3 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fd41a3e51c6bd2115cfc3d735bf19b7b8fe9de93
4
- data.tar.gz: cfcb0e8c69f2b2ddf3063af7cb8801d3d16d28d0
3
+ metadata.gz: 278adb65683904f06b7ce27682cce5eee7e8006f
4
+ data.tar.gz: d3013fe779d79bc72b1be02a950eed93aa9168d3
5
5
  SHA512:
6
- metadata.gz: f122a1601bce2fcab21b6a5ac8f74ecde0e1acd050027326321b8510ce3a15707783848d0801e112c9b8af5a2c79e08c4d9b79456158bc1e9892f573a4c64aea
7
- data.tar.gz: 7a3b439163238c4104fb8a0081c7b83d6c85cf0fd813692006f6399e17abf31f5ab075b8be94bc722bbfbd722fe2d4010b0b295e0048262b3095f17a9882faf3
6
+ metadata.gz: 49ed2595431fd9a74fda15969ee899bbca2a69eaf1b79b6d12884f41a675effc8ace6b7634c49467f1d781f8fbeb0a0f16b207e5d46bebcd87a73ebc395bd86d
7
+ data.tar.gz: 6f1d6b5cbe5d68178d9c1ee820a931cf9d62b43c7d127bf31b9a226777e00b0cbf378d9f1ec198ec0427b7553e0ddf9e1688e6b6bcd7cd50f4a37e74a227ee18
@@ -12,10 +12,12 @@ module Fetcha
12
12
  filters = params['filter']
13
13
  sorting = params['sort']
14
14
  pages = params['page']
15
+ search = params['search']
15
16
  results = process_scope(results, query_scope) if query_scope
16
17
  results = process_filtering(results, filters) if filters
17
18
  results = process_sorting(results, sorting) if sorting
18
19
  results = process_pagination!(results, pages) if pages
20
+ results = process_search(results, search) if search
19
21
  results
20
22
  end
21
23
 
@@ -64,19 +66,11 @@ module Fetcha
64
66
  datasource.send(query_scope) if (fetchable_opts[:scopes].include? query_scope.to_sym)
65
67
  end
66
68
 
67
- def process_filtering(datasource, filters)
68
- if filters.is_a?(String)
69
- full_text_filtering(datasource, filters)
70
- else
71
- hash_filtering(datasource, filters)
72
- end
73
- end
74
-
75
- def full_text_filtering(datasource, filter)
76
- datasource.search_full_text(filter)
69
+ def process_search(datasource, search)
70
+ datasource.search_full_text(search)
77
71
  end
78
72
 
79
- def hash_filtering(datasource, filters = {})
73
+ def process_filtering(datasource, filters = {})
80
74
  filter_opts = fetchable_opts[:filtering]
81
75
  includes = Set.new()
82
76
 
@@ -1,3 +1,3 @@
1
1
  module Fetcha
2
- VERSION = "0.1.3"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fetcha
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vincenzo Ferrara
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-12-20 00:00:00.000000000 Z
11
+ date: 2017-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -97,7 +97,6 @@ files:
97
97
  - Rakefile
98
98
  - bin/console
99
99
  - bin/setup
100
- - fetcha-0.1.2.gem
101
100
  - fetcha.gemspec
102
101
  - lib/fetcha.rb
103
102
  - lib/fetcha/version.rb
Binary file