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

Deprecation warning when used with Rails 6 #227

Closed
cgriego opened this issue May 3, 2019 · 7 comments
Closed

Deprecation warning when used with Rails 6 #227

cgriego opened this issue May 3, 2019 · 7 comments

Comments

@cgriego
Copy link
Contributor

cgriego commented May 3, 2019

DEPRECATION WARNING: Ruby 2.5+ (required by Rails 6) provides Hash#transform_values natively, so requiring active_support/core_ext/hash/transform_values is no longer necessary. Requiring it will raise LoadError in Rails 6.1.

@jonekdahl
Copy link

I belive this is fixed by #231.

@rafpiek
Copy link

rafpiek commented Apr 30, 2020

@jonekdahl There is again the issue when using Rails 6.0.2.2 and Ruby 2.7.1

DEPRECATION WARNING: Ruby 2.5+ (required by Rails 6) provides Hash#transform_values natively, so requiring active_support/core_ext/hash/transform_values is no longer necessary. Requiring it will raise LoadError in Rails 6.1. (called from require at /Users/rafalpiekara/Desktop/bs/AG/app/AchieveGuru/backend_achieve-guru/spec/spec_helper.rb:2)

I would be glad to take care on that and fix it. I've found the possible code here:

require 'active_support/core_ext/hash/transform_values' if Mongoid::Compatibility::Version.mongoid4_or_newer? && ActiveSupport.version < Gem::Version.new('6')

It seems to be correct, but the depreaction is present. I've checked the Mongoid repo and there is no Compatibility::Version module. Could it be deprecated? What are your thoughts on that?

@dblock
Copy link
Collaborator

dblock commented May 1, 2020

Mongoid::Compatibility is https://github.com/mongoid/mongoid-compatibility, not an official MongoDB/mongoid gem.

@btazi
Copy link

btazi commented May 15, 2020

@jonekdahl There is again the issue when using Rails 6.0.2.2 and Ruby 2.7.1

DEPRECATION WARNING: Ruby 2.5+ (required by Rails 6) provides Hash#transform_values natively, so requiring active_support/core_ext/hash/transform_values is no longer necessary. Requiring it will raise LoadError in Rails 6.1. (called from require at /Users/rafalpiekara/Desktop/bs/AG/app/AchieveGuru/backend_achieve-guru/spec/spec_helper.rb:2)

I would be glad to take care on that and fix it. I've found the possible code here:

require 'active_support/core_ext/hash/transform_values' if Mongoid::Compatibility::Version.mongoid4_or_newer? && ActiveSupport.version < Gem::Version.new('6')

It seems to be correct, but the depreaction is present. I've checked the Mongoid repo and there is no Compatibility::Version module. Could it be deprecated? What are your thoughts on that?

I've got the same warning with ruby 2.7.1 rails 6.03 and mongoid 7.1.1, did you manage to solve this ?

@icortex
Copy link

icortex commented May 20, 2020

I'm upgrading my app from Rails 5 to Rails 6.0.3, using Ruby 2.6.5 and mongoid-rspec 4.0.1 and I'm getting the same warning message.

@lestairon
Copy link

Upgrading my app to Rails 6.0.3 and getting the same warning.

@dblock
Copy link
Collaborator

dblock commented Jun 12, 2020

Released 4.1.0 that has this resolved.

@dblock dblock closed this as completed Jun 12, 2020
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

7 participants