Getting rid of DEPRECATION WARNING: env is deprecated and will be removed from Rails 5.0.

When migrating to Rails 5.0.0.beta1, I found a lot of deprecation warnings:

DEPRECATION WARNING: env is deprecated and will be removed from Rails 5.0. (called from XXX at YYY) 

I tried to get rid of this and try to find an alternative, but found nothing in the actionpack change log.

Any ideas?

+5
source share
1 answer

ok, so it seems that the env method is deprecated in ActionPack with this commit .

therefore, from now on, we must use request.env instead of env in our controllers and helpers.

+13
source

Source: https://habr.com/ru/post/1239240/


All Articles