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

Address Rails 7.1 deprecation warning in elasticsearch-rails #1067

Conversation

maciek-rr
Copy link
Contributor

@maciek-rr maciek-rr commented Dec 27, 2023

Description

This PR switches the elasticsearch-rails gem to use a new signature of the ActiveSupport::LogSubscriber#color
method when called in an app using Rails 7.1+.

With older Rails, the gem uses the working, old signature.

An example of a deprecation warning visible in 7.1 apps

DEPRECATION WARNING: Bolding log text with a positional boolean is deprecated and will be removed in Rails 7.2. Use an option hash instead (eg. `color("my text", :red, bold: true)`). (called from query_time_boundaries at timeseries/frequency_calculator.rb:44)

This PR switches the elasticsearch-rails gem to use a new signature
of the ActiveSupport::LogSubscriber#color method when called in an
app using Rails 7.1+. With older Rails, the gem uses the working, old
signature.
@spuyet
Copy link

spuyet commented May 1, 2024

@picandocodigo do you plan to merge that MR into main ?

I see that you're working on a new version for this gem, do we have any kind if ETA for the release ? thx 😄

@picandocodigo picandocodigo merged commit 98b6ce0 into elastic:main May 14, 2024
1 check passed
@maciek-rr maciek-rr deleted the misc/address-rails-7-1-log-subscriber-deprecation branch May 14, 2024 13:26
@r-plus
Copy link

r-plus commented Jun 28, 2024

hello

Do you have any plan about this PR backport to 7.x branch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants