query_helper 0.2.28 → 0.2.30

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: c635a27696eb10b152787a3b66132760bf79e3b2e695037bf6dcc2b06b39e9b9
4
- data.tar.gz: bfc80f15f647d447a6115423308368c39a2f034938731eb94f91d23a7f4c1f53
3
+ metadata.gz: 03de8ed1f4ad37b3fd8eb07edfedd5829c06e3502e78450fcbea037841a55bd7
4
+ data.tar.gz: 79598bdaca7ee9073f90858c906a5492c6eec8e4e6e514ddaa8397d0cf0afcc1
5
5
  SHA512:
6
- metadata.gz: d61105466f4cadc1b111ed38afd7e764c3d3fde76fb4db786029654516fb893df43ccf02e2b6f07693dd118ceabbc15ffa9281b2c1c7dbc388091a4f65b9e300
7
- data.tar.gz: b3c6b12c6594e1a3f068ce0d1de484f3e49bc53e1da5c99c6b7c68b27fc9c1f90e334e653b711281f0d93334a2ee95dc666d1d620a17de67ca378117e3e4c806
6
+ metadata.gz: 75cf73dd094f480095b4d0e2b8d9ae941d54a817e172dcbc3ddcc270f5c97e8c64e8303d5df8b3b0d876cb3ae5c230426920f329659892574db5889cb0ab1cd4
7
+ data.tar.gz: 25e7609715272868b5f6baf61a229d704b21cbc97f6a71be5a28126f763f9472088bc396498d60208492a2b582ac17d1994bbd2e8293c685b423c199da864e31
@@ -0,0 +1,26 @@
1
+ name: Brakeman
2
+
3
+ on: [push]
4
+
5
+ jobs:
6
+ brakeman:
7
+ runs-on: ubuntu-latest
8
+ steps:
9
+ - uses: actions/checkout@v2
10
+
11
+ - name: Set up Ruby 2.7.2
12
+ uses: ruby/setup-ruby@v1
13
+ with:
14
+ # Not needed with a .ruby-version file
15
+ ruby-version: 2.7.2
16
+ # runs 'bundle install' and caches installed gems automatically
17
+ bundler-cache: true
18
+
19
+ - name: Brakeman install
20
+ run: gem install brakeman
21
+
22
+ - name: brakeman
23
+ id: brakeman
24
+ run: |
25
+ brakeman --color --force -q
26
+ if [ $? -ne 0 ]; then return 1; fi
@@ -0,0 +1,20 @@
1
+ name: Publish Gem
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - v*
7
+ jobs:
8
+ build:
9
+ runs-on: ubuntu-latest
10
+
11
+ steps:
12
+ - uses: actions/checkout@v1
13
+
14
+ - name: Release Gem
15
+ if: contains(github.ref, 'refs/tags/v')
16
+ uses: cadwallion/publish-rubygems-action@master
17
+ env:
18
+ GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
19
+ RUBYGEMS_API_KEY: ${{secrets.RUBYGEMS_API_KEY}}
20
+ RELEASE_COMMAND: rake release
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- query_helper (0.2.28)
4
+ query_helper (0.2.30)
5
5
  activerecord (> 5)
6
6
  activesupport (> 5)
7
7
  sqlite3
@@ -26,7 +26,8 @@ class QueryHelper
26
26
  end
27
27
 
28
28
  def create_query_helper_filter
29
- filter_values = params[:filter].permit!.to_h
29
+ # Here we get dynamic filter variable and hence we can't define permit.
30
+ filter_values = params[:filter].to_unsafe_h
30
31
  QueryHelper::SqlFilter.new(filter_values: filter_values)
31
32
  end
32
33
 
@@ -83,7 +83,7 @@ class QueryHelper
83
83
 
84
84
  begin_string = @parser.qualify_included? ? "and" : "qualify"
85
85
  filter_string = @qualify_clauses.join(" and ")
86
- @sql.insert(@parser.insert_where_index, " #{begin_string} #{filter_string} ")
86
+ @sql.insert(@parser.insert_qualify_index, " #{begin_string} #{filter_string} ")
87
87
  end
88
88
 
89
89
  def qualify_clause_applicable?
@@ -117,6 +117,10 @@ class QueryHelper
117
117
  group_by_index() || order_by_index() || limit_index() || @sql.length
118
118
  end
119
119
 
120
+ def insert_qualify_index
121
+ order_by_index() || limit_index() || @sql.length
122
+ end
123
+
120
124
  def insert_having_index
121
125
  # raise InvalidQueryError.new("Cannot calculate insert_having_index because the query has no group by clause") unless group_by_included?
122
126
  order_by_index() || limit_index() || @sql.length
@@ -1,3 +1,3 @@
1
1
  class QueryHelper
2
- VERSION = "0.2.28"
2
+ VERSION = "0.2.30"
3
3
  end
data/query_helper.gemspec CHANGED
@@ -6,12 +6,12 @@ require "query_helper/version"
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "query_helper"
8
8
  spec.version = QueryHelper::VERSION
9
- spec.authors = ["Evan McDaniel"]
10
- spec.email = ["eamigo13@gmail.com"]
9
+ spec.authors = ["Patterninc"]
10
+ spec.email = ["jason@pattern.com"]
11
11
 
12
12
  spec.summary = %q{Ruby Gem to help with pagination and data formatting at Pattern, Inc.}
13
13
  spec.description = %q{Ruby gem developed to help with pagination, filtering, sorting, and including associations on both active record queries and custom sql queries}
14
- spec.homepage = "https://github.com/iserve-products/query_helper"
14
+ spec.homepage = "https://github.com/patterninc/query_helper"
15
15
  spec.license = "MIT"
16
16
 
17
17
  # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
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.2.28
4
+ version: 0.2.30
5
5
  platform: ruby
6
6
  authors:
7
- - Evan McDaniel
7
+ - Patterninc
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-04-05 00:00:00.000000000 Z
11
+ date: 2022-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -167,12 +167,14 @@ dependencies:
167
167
  description: Ruby gem developed to help with pagination, filtering, sorting, and including
168
168
  associations on both active record queries and custom sql queries
169
169
  email:
170
- - eamigo13@gmail.com
170
+ - jason@pattern.com
171
171
  executables: []
172
172
  extensions: []
173
173
  extra_rdoc_files: []
174
174
  files:
175
+ - ".github/workflows/brakeman.yml"
175
176
  - ".github/workflows/ci.yml"
177
+ - ".github/workflows/publish_rubygems.yml"
176
178
  - ".gitignore"
177
179
  - ".rspec"
178
180
  - CODE_OF_CONDUCT.md
@@ -195,7 +197,7 @@ files:
195
197
  - lib/query_helper/sql_sort.rb
196
198
  - lib/query_helper/version.rb
197
199
  - query_helper.gemspec
198
- homepage: https://github.com/iserve-products/query_helper
200
+ homepage: https://github.com/patterninc/query_helper
199
201
  licenses:
200
202
  - MIT
201
203
  metadata: {}