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

rendered_format is removed in Rails 6.1 #93

Closed
nicksoto opened this issue Oct 1, 2019 · 4 comments
Closed

rendered_format is removed in Rails 6.1 #93

nicksoto opened this issue Oct 1, 2019 · 4 comments

Comments

@nicksoto
Copy link

nicksoto commented Oct 1, 2019

the relevant commit is here

@javierjulio
Copy link

Based on that commit and seeing other repos that have updated to account for the deprecation warning, I think we just need to change this line:

format = view.lookup_context.rendered_format || :json

to do the following instead:

format = view.lookup_context.formats.first || :json

Note: I'm not sure if that change would work on older Rails versions though.

I think this change in that same commit Nick shared backs the above suggestion since the rendered_format was set with the same value.

@javierjulio
Copy link

The rspec-rails gem has addressed the same issue here: rspec/rspec-rails#2100 so that should confirm the solution and that the change has to be conditional for Rails 6 and then anything else for older versions.

@navidemad
Copy link

navidemad commented Dec 2, 2019

Something like this :

format = (::Rails::VERSION::STRING >= '6' ? view.lookup_context.formats.first : view.lookup_context.rendered_format) || :json

@ccocchi
Copy link
Owner

ccocchi commented Feb 4, 2021

Thank you, the warning have been removed in version 0.6.0 🙂

@ccocchi ccocchi closed this as completed Feb 4, 2021
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

No branches or pull requests

4 participants