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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 216dd6ebcc3d4be6014068002ae576a58bb0ec6a040fea677c1b34cd179d2d0e
4
- data.tar.gz: 445170ef612bcfa6342bcd3c0be20d29067d672e038e85b50832cea83322c008
3
+ metadata.gz: a27ca095e7c4d3068540e36e523109f0e1e03bc2c3da465aba7ede82e54d9a98
4
+ data.tar.gz: b7e0406b8c275e5996234c8e5a528c615c75483532b5f5a91b7926e88a0ed885
5
5
  SHA512:
6
- metadata.gz: 8d412f5a205b9120b3a67a337cf67e829f89f9b9729ede92728c13e5de9fc98afbde03db42d1c23a7ada03027d208f24bfa3725a4e6ec1a21900900717370c6c
7
- data.tar.gz: 8df8fbe91ceb8585b0dcd5b50a32e9a26bfdbb1784451c8e4e1f3f2e3f909112b8ecfd2ea97b0a7619ee19fc225144ab086f6ca09983c612336f035810488474
6
+ metadata.gz: 2f50dbcf3dc0e2de1afa33b2b59318ade4154eae8b4e2f9400ff8bcc4fd144515e4c021a6f65235b5d384b40cc5a743f0e9db122b5d5f50376f376d4ea784fe0
7
+ data.tar.gz: 107dc690d8dc7e9672a7516fe1da95ebf9a2b65263e6dfae962d6587b7372935a349e53d18f101d049f44e7fd01fa0cb887c1bd2798013dbdcf4ee27b0ac03f0
@@ -17,7 +17,7 @@ jobs:
17
17
  bundler-cache: true
18
18
 
19
19
  - name: Brakeman install
20
- run: gem install brakeman
20
+ run: gem install brakeman -v 5.4.1
21
21
 
22
22
  - name: brakeman
23
23
  id: brakeman
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- query_helper (0.3.5)
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.2)
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
@@ -1,3 +1,3 @@
1
1
  class QueryHelper
2
- VERSION = "0.3.5"
2
+ VERSION = "0.3.6"
3
3
  end
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.5
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-19 00:00:00.000000000 Z
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: []