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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/pattern_query_helper/version.rb +1 -1
- data/lib/pattern_query_helper.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d80b1ac39e887931fa741b1b0d5e8e3eac8e86b3
|
4
|
+
data.tar.gz: 6b42d27cd476ee84ad1438a220d7230c35484182
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b788897d5d99e1f236d07906a2ecf2217c25e2dd2ce20d2a3e8299576103a2708f7a89542b6e14d68a165aa2bb52804a634ee51cb134eaf0f03ee535c1a2dff0
|
7
|
+
data.tar.gz: 851a0726152bdfed51bcd0cb15c99a3142a1779f3a7c068e4e00cdcad2bed4857a99a1b61731d0b7807a3aa4bdcc02dfa978419acd3730f787dd7d27c8a23d62
|
data/Gemfile.lock
CHANGED
data/lib/pattern_query_helper.rb
CHANGED
@@ -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
|
-
|
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.
|
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-
|
11
|
+
date: 2019-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|