Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error when warning about pagy configuration redundancy #295

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
MeiliSearch::Rails.logger
.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
5 changes: 3 additions & 2 deletions spec/integration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -803,12 +803,13 @@
Movie.create(title: 'Harry Potter').index!(true)

logger = double
allow(logger).to receive(:warning)

allow(logger).to receive(:warn)
allow(MeiliSearch::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