Skip to content

Commit

Permalink
Fix style
Browse files Browse the repository at this point in the history
  • Loading branch information
fdaugs committed Nov 8, 2024
1 parent d2a4143 commit 596539f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ end

### Filtering sql queries by name

You can filter out queries using the `query_name_denylist` configuration. This takes an array of regular expressions to match against the query name. If the query name matches any of the regular expressions, it will be ignored. By default, `lograge-sql` ignores queries named `SCHEMA` and queries from the `SolidCable` namespace. If you are using Solid Cable in your project, be careful when removing this default value as it will cause a [memory leak](https://github.com/iMacTia/lograge-sql/issues/59).
You can filter out queries using the `query_name_denylist` configuration.
This takes an array of regular expressions to match against the query name. If the query name matches any of the regular expressions, it will be ignored. By default, `lograge-sql` ignores queries named `SCHEMA` and queries from the `SolidCable` namespace.
If you are using Solid Cable in your project, be careful when removing this default value as it will cause a [memory leak](https://github.com/iMacTia/lograge-sql/issues/59).

```ruby
# config/initializers/lograge.rb
Rails.application.configure do
Expand Down Expand Up @@ -102,7 +105,6 @@ Rails.application.configure do
end
```


### Thread-safety

[Depending on the web server in your project](https://github.com/steveklabnik/request_store#the-problem) you might benefit from improved thread-safety by adding [`request_store`](https://github.com/steveklabnik/request_store) to your Gemfile. It will be automatically picked up by `lograge-sql`.
Expand Down
8 changes: 4 additions & 4 deletions spec/lograge/active_record_log_subscriber_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@
end
end

context "with default name denylist" do
context 'with default name denylist' do
before do
allow(Rails).to receive_message_chain('application.config.lograge_sql.keep_default_active_record_log') { true }
end

context "with SCHEMA as name" do
context 'with SCHEMA as name' do
before do
allow(event).to receive(:payload).and_return({ name: 'SCHEMA' })
end
Expand All @@ -93,7 +93,7 @@
end
end

context "with name starting with SCHEMA" do
context 'with name starting with SCHEMA' do
before do
allow(event).to receive(:payload).and_return({ name: 'SCHEMA foo' })
end
Expand All @@ -104,7 +104,7 @@
end
end

context "with name starting with SolidCable::" do
context 'with name starting with SolidCable::' do
before do
allow(event).to receive(:payload).and_return({ name: 'SolidCable::Message Maximum' })
end
Expand Down

0 comments on commit 596539f

Please sign in to comment.