meilisearch / meilisearch-rails

Meilisearch integration for Ruby on Rails
https://www.meilisearch.com
MIT License
295 stars 47 forks source link

Call to non-existant method Rails::Logger.warning (should be warn) #294

Closed ellnix closed 9 months ago

ellnix commented 11 months ago

Description In MeiliSearch::Rails::Pagination.log_pagy_error there is a call to Logger#warning which does not exist. In fact triggering this warning by adding pagination_backend: 'pagy' in MeiliSearch::Rails.configuration will throw an error upon trying to paginate search results.

Expected behavior A warning is logged, execution continues.

Current behavior The request gets interrupted by an exception.

Screenshots or Logs

NoMethodError (undefined method `warning' for #<ActiveSupport::Logger:0x00007f3fbdc5ab30 @level=0, @progname=nil, @default_formatter=#<Logger::Formatter:0x00007f3fbdc4d
f98 @datetime_format=nil>, @formatter=#<ActiveSupport::Logger::SimpleFormatter:0x00007f3fbdc5a9c8 @datetime_format=nil, @thread_key="activesupport_tagged_logging_tags:1
4380">, @logdev=#<Logger::LogDevice:0x00007f3fbdc4de58 @shift_period_suffix="%Y%m%d", @shift_size=1048576, @shift_age=0, @filename="/home/ellnix/Code/github/ell
nix/meilisearch_rails_bookstore/log/development.log", @dev=#<File:/home/ellnix/Code/github/ellnix/meilisearch_rails_bookstore/log/development.log>, @binmode=fal
se, @mon_data=#<Monitor:0x00007f3fbdc4de08>, @mon_data_owner_object_id=3940>>

          .warning('[meilisearch-rails] Remove `pagination_backend: :pagy` from your initializer, `pagy` it is not required for `pagy`')
          ^^^^^^^^
Did you mean?  warn):

Environment (please complete the following information):