query_helper 0.3.5 → 0.3.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/brakeman.yml +1 -1
- data/Gemfile.lock +2 -2
- data/lib/query_helper/sql_sort.rb +4 -3
- data/lib/query_helper/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a27ca095e7c4d3068540e36e523109f0e1e03bc2c3da465aba7ede82e54d9a98
|
4
|
+
data.tar.gz: b7e0406b8c275e5996234c8e5a528c615c75483532b5f5a91b7926e88a0ed885
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f50dbcf3dc0e2de1afa33b2b59318ade4154eae8b4e2f9400ff8bcc4fd144515e4c021a6f65235b5d384b40cc5a743f0e9db122b5d5f50376f376d4ea784fe0
|
7
|
+
data.tar.gz: 107dc690d8dc7e9672a7516fe1da95ebf9a2b65263e6dfae962d6587b7372935a349e53d18f101d049f44e7fd01fa0cb887c1bd2798013dbdcf4ee27b0ac03f0
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
query_helper (0.3.
|
4
|
+
query_helper (0.3.6)
|
5
5
|
activerecord (> 5)
|
6
6
|
activesupport (> 5)
|
7
7
|
sqlite3
|
@@ -89,7 +89,7 @@ GEM
|
|
89
89
|
rspec-mocks (~> 3.10)
|
90
90
|
rspec-support (~> 3.10)
|
91
91
|
rspec-support (3.10.2)
|
92
|
-
sqlite3 (1.6.
|
92
|
+
sqlite3 (1.6.4)
|
93
93
|
mini_portile2 (~> 2.8.0)
|
94
94
|
thor (1.1.0)
|
95
95
|
tzinfo (2.0.4)
|
@@ -5,12 +5,13 @@ class QueryHelper
|
|
5
5
|
|
6
6
|
attr_accessor :column_maps, :select_strings, :sort_tiebreak, :column_sort_order
|
7
7
|
|
8
|
-
def initialize(sort_string: "", sort_tiebreak: "", column_maps: [], column_sort_order: {})
|
8
|
+
def initialize(sort_string: "", sort_tiebreak: "", column_maps: [], column_sort_order: {}, keep_nulls_last: false)
|
9
9
|
@sort_string = sort_string
|
10
10
|
@column_maps = column_maps
|
11
11
|
@sort_tiebreak = sort_tiebreak
|
12
12
|
@column_sort_order = column_sort_order
|
13
13
|
@select_strings = []
|
14
|
+
@keep_nulls_last = keep_nulls_last
|
14
15
|
end
|
15
16
|
|
16
17
|
def parse_sort_string
|
@@ -41,12 +42,12 @@ class QueryHelper
|
|
41
42
|
if direction == "desc"
|
42
43
|
case ActiveRecord::Base.connection.adapter_name
|
43
44
|
when "SQLite" # SQLite is used in the test suite
|
44
|
-
direction = "desc"
|
45
|
+
direction = @keep_nulls_last ? "desc nulls last" : "desc"
|
45
46
|
else
|
46
47
|
direction = "desc nulls last"
|
47
48
|
end
|
48
49
|
else
|
49
|
-
direction = "asc"
|
50
|
+
direction = @keep_nulls_last ? "asc nulls last" : "asc"
|
50
51
|
end
|
51
52
|
|
52
53
|
case modifier
|
data/lib/query_helper/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: query_helper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Patterninc
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-04
|
11
|
+
date: 2023-09-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -201,7 +201,7 @@ homepage: https://github.com/patterninc/query_helper
|
|
201
201
|
licenses:
|
202
202
|
- MIT
|
203
203
|
metadata: {}
|
204
|
-
post_install_message:
|
204
|
+
post_install_message:
|
205
205
|
rdoc_options: []
|
206
206
|
require_paths:
|
207
207
|
- lib
|
@@ -217,7 +217,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
217
217
|
version: '0'
|
218
218
|
requirements: []
|
219
219
|
rubygems_version: 3.4.10
|
220
|
-
signing_key:
|
220
|
+
signing_key:
|
221
221
|
specification_version: 4
|
222
222
|
summary: Ruby Gem to help with pagination and data formatting at Pattern, Inc.
|
223
223
|
test_files: []
|