public-activity / public_activity

Easy activity tracking for models - similar to Github's Public Activity

Home Page:https://github.com/pokonski/public_activity

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Method to_hash is deprecated and will be removed in Rails 5.1

karlingen opened this issue · comments

Getting deprecation warnings when running my tests.

DEPRECATION WARNING: Method to_hash is deprecated and will be removed in Rails 5.1, as ActionController::Parameters no longer inherits from hash.
Using this deprecated behavior exposes potential security problems.
If you continue to use this method you may be creating a security vulnerability in your app that can be exploited. Instead, consider using one of these documented methods which are not deprecated:
http://api.rubyonrails.org/v5.0.2/classes/ActionController/Parameters.html (called from merge! at /Users/karlingen/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/public_activity-aff5b50ff474/lib/public_activity/common.rb:259)

We should probably fix this soon :)

Seems to be an issue with rails. Calling merge or merge! triggers the underlying method to_hash in older versions of rails.

rails/rails#26418

I'm guessing we need to update railties and minitest to fix this.

This also means the tests needs to be re-written with the new testing syntax

Rails 5.0 and 5.2 are now supported in version 1.6.0 https://github.com/chaps-io/public_activity/releases/tag/v1.6 :)

@karlingen

Good times!! :)