Skip to content

Commit

Permalink
Call Logger.warn instead of Logger.warning
Browse files Browse the repository at this point in the history
  • Loading branch information
ellnix committed Nov 1, 2023
1 parent b63cb6c commit f8cfd39
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/meilisearch/rails/pagination.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def self.create(results, total_hits, options = {})

def self.log_pagy_error
(::Rails.logger || Logger.new($stdout))
.warning('[meilisearch-rails] Remove `pagination_backend: :pagy` from your initializer, `pagy` it is not required for `pagy`')
.warn('[meilisearch-rails] Remove `pagination_backend: :pagy` from your initializer, `pagy` it is not required for `pagy`')
end

def self.load_pagination!(pagination_backend, results, total_hits, options)
Expand Down
4 changes: 2 additions & 2 deletions spec/integration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -781,12 +781,12 @@

it 'has meaningful error when pagy is set as the pagination_backend' do
logger = double
allow(logger).to receive(:warning)
allow(logger).to receive(:warn)
allow(::Rails).to receive(:logger).and_return(logger)

Movie.search('')

expect(logger).to have_received(:warning)
expect(logger).to have_received(:warn)
.with('[meilisearch-rails] Remove `pagination_backend: :pagy` from your initializer, `pagy` it is not required for `pagy`')
end
end
Expand Down

0 comments on commit f8cfd39

Please sign in to comment.