Skip to content

Rails 5 generating deprecation warning when using strong parameter #362

@cesarjr

Description

@cesarjr

I'm using Rails 5 and this deprecation warning is been shown:

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.0/classes/ActionController/Parameters.html

This is my code:

track = API::Tracker::Track.new(track_params)

And this is my work around:

track = API::Tracker::Track.new(track_params.to_h)

Is there any permanent solution?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions