prosopite 1.3.0 → 1.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +2 -2
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/prosopite/version.rb +1 -1
- data/lib/prosopite.rb +6 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c755dcf6b652f0c40d14ff94a4f6dc7beb9cc4f9612cff5ea95ce272d81b31bb
|
4
|
+
data.tar.gz: 4c15915fb03a38760c93edd4fa5c12a7db3d48d1611d470f320a494c3f6673a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1048554ad84f00835366801abd599fd590512d88d1523de3434ee24eec23aac9a9f1506084244295cbd34b80808b1ade2068027e958e531028d70ea9df21b970
|
7
|
+
data.tar.gz: 5acd7e945c9056875adb72cc4222ec766df17f7ff638e1307de28b8a4486067df40f736522a9dd4f10d69da859350fcb9477fe98de4027ca57b362cb9bf930b8
|
data/.github/workflows/ci.yml
CHANGED
@@ -4,10 +4,10 @@ jobs:
|
|
4
4
|
test:
|
5
5
|
strategy:
|
6
6
|
matrix:
|
7
|
-
ruby: [2.7, '3.0', 3.1,
|
7
|
+
ruby: [2.7, '3.0', 3.1, 3.2]
|
8
8
|
runs-on: ubuntu-latest
|
9
9
|
steps:
|
10
|
-
- uses: actions/checkout@
|
10
|
+
- uses: actions/checkout@v3
|
11
11
|
- uses: ruby/setup-ruby@v1
|
12
12
|
with:
|
13
13
|
bundler-cache: true
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -120,8 +120,8 @@ The preferred type of notifications can be configured with:
|
|
120
120
|
* `Prosopite.rails_logger = true`: Send warnings to the Rails log
|
121
121
|
* `Prosopite.prosopite_logger = true`: Send warnings to `log/prosopite.log`
|
122
122
|
* `Prosopite.stderr_logger = true`: Send warnings to STDERR
|
123
|
+
* `Prosopite.backtrace_cleaner = my_custom_backtrace_cleaner`: use a different [ActiveSupport::BacktraceCleaner](https://api.rubyonrails.org/classes/ActiveSupport/BacktraceCleaner.html). Defaults to `Rails.backtrace_cleaner`.
|
123
124
|
* `Prosopite.custom_logger = my_custom_logger`:
|
124
|
-
* `Prosopite.backtrace_cleaner = my_custom_backtrace_cleaner`: use a different [ActiveSupport::BacktraceCleaner](https://api.rubyonrails.org/classes/ActiveSupport/BacktraceCleaner.html). Default to `Rails.backtrace_cleaner` if present.
|
125
125
|
|
126
126
|
### Custom Logging Configuration
|
127
127
|
|
data/lib/prosopite/version.rb
CHANGED
data/lib/prosopite.rb
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
|
2
2
|
module Prosopite
|
3
|
-
DEFAULT_ALLOW_LIST =
|
3
|
+
DEFAULT_ALLOW_LIST = [
|
4
|
+
/active_record\/relation.rb.*preload_associations/,
|
5
|
+
'active_record/validations/uniqueness'
|
6
|
+
].freeze
|
4
7
|
|
5
8
|
class NPlusOneQueriesError < StandardError; end
|
6
9
|
class << self
|
@@ -176,6 +179,8 @@ module Prosopite
|
|
176
179
|
|
177
180
|
query.gsub!(/\b(in|values?)(?:[\s,]*\([\s?,]*\))+/, "\\1(?+)")
|
178
181
|
|
182
|
+
query.gsub!(/(?<!\w)field\s*\(\s*(\S+)\s*,\s*(\?+)(?:\s*,\s*\?+)*\)/, 'field(\1, \2+)')
|
183
|
+
|
179
184
|
query.gsub!(/\b(select\s.*?)(?:(\sunion(?:\sall)?)\s\1)+/, "\\1 /*repeat\\2*/")
|
180
185
|
|
181
186
|
query.gsub!(/\blimit \?(?:, ?\?| offset \?)/, "limit ?")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: prosopite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mpampis Kostas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-06-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|
@@ -146,7 +146,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
146
146
|
- !ruby/object:Gem::Version
|
147
147
|
version: '0'
|
148
148
|
requirements: []
|
149
|
-
rubygems_version: 3.
|
149
|
+
rubygems_version: 3.4.6
|
150
150
|
signing_key:
|
151
151
|
specification_version: 4
|
152
152
|
summary: N+1 auto-detection for Rails with zero false positives / false negatives
|