query_helper 0.2.28 → 0.2.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/brakeman.yml +26 -0
- data/.github/workflows/publish_rubygems.yml +20 -0
- data/Gemfile.lock +1 -1
- data/lib/query_helper/query_helper_concern.rb +2 -1
- data/lib/query_helper/sql_manipulator.rb +1 -1
- data/lib/query_helper/sql_parser.rb +4 -0
- data/lib/query_helper/version.rb +1 -1
- data/query_helper.gemspec +3 -3
- metadata +7 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 03de8ed1f4ad37b3fd8eb07edfedd5829c06e3502e78450fcbea037841a55bd7
|
4
|
+
data.tar.gz: 79598bdaca7ee9073f90858c906a5492c6eec8e4e6e514ddaa8397d0cf0afcc1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
@@ -26,7 +26,8 @@ class QueryHelper
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def create_query_helper_filter
|
29
|
-
|
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.
|
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
|
data/lib/query_helper/version.rb
CHANGED
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 = ["
|
10
|
-
spec.email = ["
|
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/
|
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.
|
4
|
+
version: 0.2.30
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Patterninc
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
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
|
-
-
|
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/
|
200
|
+
homepage: https://github.com/patterninc/query_helper
|
199
201
|
licenses:
|
200
202
|
- MIT
|
201
203
|
metadata: {}
|