istox 0.1.96 → 0.1.97.pre.1

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
  SHA256:
3
- metadata.gz: b2f728402833b922790650e9ef4467ae0718e5843379d3b723e0100f63a396b2
4
- data.tar.gz: 4ca29c04dbed5ea7215d18dc4a71ad60ce806782538c1964468b09470957e7c9
3
+ metadata.gz: 321fc95249c26a00d4b85d4069621ee0cb5b67b2ad175f9858ee27f5a7fc4b8a
4
+ data.tar.gz: '0739da512f7f81b020075e3e5087d590638a230684a149e4be90c742b3e03b96'
5
5
  SHA512:
6
- metadata.gz: 23cd76ac51cde8ca14c92aed00e36142d7f826cb0617bc1de779d310e9647cf15e6280dc8a10810c8675a30a81a514b096fc8e6ba705fc25b57c8a8a2c8b99a0
7
- data.tar.gz: 6c7d1d5dee9ef7ca1ee57e1f7de5af6ff7c0af8a7fa786786c8be0f565410f476cd03bedbd604ac5d3d9933ffcc9e9518ec9c4b6d356c3c34af1c0b794ee8726
6
+ metadata.gz: 3f3b13d166f18bf4e10f22442c043e6210d02fc78970356db61a97cdd6ea592067cfca8ee6830b63a7d6108081a5be7fb530ccc92eec0ed16d387662c386aafd
7
+ data.tar.gz: d1af245f236104a0dbdc2cac529f1045bd342e90d09cecbb07ae591591dac31a4a8f7aef112a8e8373da067bb3f8164ed1e42837f773687543d8d7156c96da97
@@ -1,17 +1,15 @@
1
1
  module Istox
2
2
  module Filter
3
- def self.filter_query(query:, filters:)
4
- current_page = filters.page
5
- offset = (current_page - 1) * filters.limit
6
-
7
- filters&.filter&.each do |x|
8
- query = query.where("#{x.type.downcase} LIKE ?", "%#{x.value}%")
9
- end
10
-
3
+ def self.order_data(query:, filters:)
11
4
  filters&.sort&.each do |x|
12
5
  query = query.order("#{x.field.downcase} #{x.order.upcase}")
13
6
  end
7
+ query
8
+ end
14
9
 
10
+ def self.paginate_data(query:, filters:)
11
+ current_page = filters.page
12
+ offset = (current_page - 1) * filters.limit
15
13
  total = query.count
16
14
  data = query.limit(filters.limit).offset(offset)
17
15
 
data/lib/istox/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Istox
2
- VERSION = '0.1.96'.freeze
2
+ VERSION = '0.1.97-1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: istox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.96
4
+ version: 0.1.97.pre.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Siong Leng
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-11-19 00:00:00.000000000 Z
11
+ date: 2019-11-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bunny
@@ -323,9 +323,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
323
323
  version: '0'
324
324
  required_rubygems_version: !ruby/object:Gem::Requirement
325
325
  requirements:
326
- - - ">="
326
+ - - ">"
327
327
  - !ruby/object:Gem::Version
328
- version: '0'
328
+ version: 1.3.1
329
329
  requirements: []
330
330
  rubygems_version: 3.0.6
331
331
  signing_key: