pattern_query_helper 0.1.7 → 0.1.8

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: 5933735e1e09a3803b1a896b909bcfac03df72ef
4
- data.tar.gz: 6a7b84868229e6faba1a39e3751fb3f562cc8098
3
+ metadata.gz: d80b1ac39e887931fa741b1b0d5e8e3eac8e86b3
4
+ data.tar.gz: 6b42d27cd476ee84ad1438a220d7230c35484182
5
5
  SHA512:
6
- metadata.gz: f92ea4b1daa987c102a23aff0125941a37255e57ba2c773588466c9ed68c520176bcdb1642dbb25c1ee1506b870e66da8159eef455d576f4985f5a0839cdba1a
7
- data.tar.gz: d9ee2ebcd3e3008fe1212ba3838835a4158468ef6e534821cd60d951c7ba8b348873d2a87f5b7c01811fecf3e80aefcce4a27a079f9b41c8cc2fc40bc4eaf59f
6
+ metadata.gz: b788897d5d99e1f236d07906a2ecf2217c25e2dd2ce20d2a3e8299576103a2708f7a89542b6e14d68a165aa2bb52804a634ee51cb134eaf0f03ee535c1a2dff0
7
+ data.tar.gz: 851a0726152bdfed51bcd0cb15c99a3142a1779f3a7c068e4e00cdcad2bed4857a99a1b61731d0b7807a3aa4bdcc02dfa978419acd3730f787dd7d27c8a23d62
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pattern_query_helper (0.1.7)
4
+ pattern_query_helper (0.1.8)
5
5
  activerecord (~> 5.0)
6
6
  kaminari
7
7
 
@@ -1,3 +1,3 @@
1
1
  module PatternQueryHelper
2
- VERSION = "0.1.7"
2
+ VERSION = "0.1.8"
3
3
  end
@@ -110,7 +110,8 @@ module PatternQueryHelper
110
110
  sorted_query = PatternQueryHelper::Sorting.sort_active_record_query(active_record_call, query_helpers[:sorting])
111
111
  paginated_query = PatternQueryHelper::Pagination.paginate_active_record_query(sorted_query, query_helpers[:pagination])
112
112
  with_associations = PatternQueryHelper::Associations.load_associations(paginated_query, query_helpers[:associations])
113
- pagination = PatternQueryHelper::Pagination.create_pagination_payload(sorted_query.count, query_helpers[:pagination])
113
+ count = ActiveRecord::Base.connection.execute(%{with query as (#{sorted_query.to_sql}) select count(*) as count from query}).first["count"].to_i
114
+ pagination = PatternQueryHelper::Pagination.create_pagination_payload(count, query_helpers[:pagination])
114
115
  {
115
116
  pagination: pagination,
116
117
  data: with_associations
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pattern_query_helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan McDaniel
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-02-28 00:00:00.000000000 Z
11
+ date: 2019-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler