diff --git a/.github/workflows/config.yml b/.github/workflows/config.yml index 4aff402..556266a 100644 --- a/.github/workflows/config.yml +++ b/.github/workflows/config.yml @@ -9,6 +9,9 @@ jobs: matrix: ruby-version: [2.6, 2.7, 3.0] rails-version: [5_2, 6_0, 6_1] + exclude: + - rails-version: 5_2 + ruby-version: 3.0 fail-fast: false # Service containers to run with `runner-job` diff --git a/CHANGELOG.md b/CHANGELOG.md index 419abfb..be3ed6e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ ### Bug fixes +## 1.1.1 (2021-10-08) + +### Changes + +- [#127](https://github.com/rootstrap/exception_hunter/pull/127) Upgrade to Pagy from 3.x to 4.x ([@megatux][]) + ## 1.1.0 (2021-07-30) ### New features diff --git a/Gemfile.lock b/Gemfile.lock index 92f3f19..567648d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -31,7 +31,7 @@ PATH remote: . specs: exception_hunter (1.1.0) - pagy (~> 3) + pagy (~> 4) slack-notifier (~> 2.3) GEM @@ -160,7 +160,7 @@ GEM mini_portile2 (~> 2.5.0) racc (~> 1.4) orm_adapter (0.5.0) - pagy (3.14.0) + pagy (4.11.0) parallel (1.20.1) parser (2.7.2.0) ast (~> 2.4.1) @@ -307,4 +307,4 @@ DEPENDENCIES yard (~> 0.9.25) BUNDLED WITH - 2.1.4 + 2.2.28 diff --git a/app/views/exception_hunter/errors/pagy/_pagy_nav.html.erb b/app/views/exception_hunter/errors/pagy/_pagy_nav.html.erb index 081d036..66a7da8 100644 --- a/app/views/exception_hunter/errors/pagy/_pagy_nav.html.erb +++ b/app/views/exception_hunter/errors/pagy/_pagy_nav.html.erb @@ -1,17 +1,17 @@
- <%= link_to pagy_url_for(1, pagy) do %> - <%= button_tag 'First', class: %w[button button-outline error-occurrences__nav-link], disabled: pagy.prev.nil? %> + <%= link_to pagy_url_for(pagy, 1) do %> + <%= button_tag "First", class: %w[button button-outline error-occurrences__nav-link], disabled: pagy.prev.nil? %> <% end %> - <%= link_to pagy_url_for(pagy.prev, pagy) do %> - <%= button_tag '<', class: %w[button button-outline error-occurrences__nav-link], disabled: pagy.prev.nil? %> + <%= link_to pagy_url_for(pagy, pagy.prev) do %> + <%= button_tag "<", class: %w[button button-outline error-occurrences__nav-link], disabled: pagy.prev.nil? %> <% end %>
<%= occurred_at %> (<%= pagy.page %>/<%= pagy.last %>)
- <%= link_to pagy_url_for(pagy.next, pagy) do %> - <%= button_tag '>', class: %w[button button-outline error-occurrences__nav-link], disabled: pagy.next.nil? %> + <%= link_to pagy_url_for(pagy, pagy.next) do %> + <%= button_tag ">", class: %w[button button-outline error-occurrences__nav-link], disabled: pagy.next.nil? %> <% end %> - <%= link_to pagy_url_for(pagy.last, pagy) do %> - <%= button_tag 'Last', class: %w[button button-outline error-occurrences__nav-link], disabled: pagy.next.nil? %> + <%= link_to pagy_url_for(pagy, pagy.last) do %> + <%= button_tag "Last", class: %w[button button-outline error-occurrences__nav-link], disabled: pagy.next.nil? %> <% end %>
diff --git a/exception_hunter.gemspec b/exception_hunter.gemspec index 734ace2..ff0691f 100644 --- a/exception_hunter.gemspec +++ b/exception_hunter.gemspec @@ -18,7 +18,7 @@ Gem::Specification.new do |spec| EXCLUDED_FILES = %w[lib/tasks/code_analysis.rake].freeze spec.files = Dir['{app,config,db,lib}/**/*', 'MIT-LICENSE', 'Rakefile', 'README.md'] - EXCLUDED_FILES - spec.add_dependency 'pagy', '~> 3' + spec.add_dependency 'pagy', '~> 4' spec.add_dependency 'slack-notifier', '~> 2.3' spec.add_development_dependency 'brakeman', '~> 4.8' diff --git a/lib/exception_hunter/error_creator.rb b/lib/exception_hunter/error_creator.rb index 2653011..87e9294 100644 --- a/lib/exception_hunter/error_creator.rb +++ b/lib/exception_hunter/error_creator.rb @@ -29,17 +29,18 @@ def call(async_logging: Config.async_logging, tag: nil, **error_attrs) def create_error(tag, error_attrs) ActiveRecord::Base.transaction do - error_attrs = extract_user_data(error_attrs) + error_attrs = extract_user_data(**error_attrs) error_attrs = hide_sensitive_values(error_attrs) error = ::ExceptionHunter::Error.new(error_attrs) error_group = ::ExceptionHunter::ErrorGroup.find_matching_group(error) || ::ExceptionHunter::ErrorGroup.new update_error_group(error_group, error, tag) error.error_group = error_group error.save! - return if error_group.ignored? - notify(error) - error + unless error_group.ignored? + notify(error) + error + end end end diff --git a/spec/error_creator_spec.rb b/spec/error_creator_spec.rb index ae0b769..d46412b 100644 --- a/spec/error_creator_spec.rb +++ b/spec/error_creator_spec.rb @@ -44,8 +44,7 @@ module ExceptionHunter context 'with repeating tag' do before do - error_attributes[:tag] = ErrorCreator::HTTP_TAG - described_class.call(error_attributes) + described_class.call(tag: ErrorCreator::HTTP_TAG, **error_attributes) end it 'does not repeat tags' do