How do I resolve the deprecation warning "Method to_hash is deprecated and will be removed in Rails 5.1" : <p>I'm trying to update to Rails 5, I'm getting the following deprecation warning:</p>

<blockquote>
  <p>DEPRECATION WARNING: Method to_hash is deprecated and will be removed in Rails 5.1, as <code>ActionController::Parameters</code> 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: <a href="http://api.rubyonrails.org/v5.0.0/classes/ActionController/Parameters.html" rel="noreferrer">http://api.rubyonrails.org/v5.0.0/classes/ActionController/Parameters.html</a> (called from column_header at /Data/Projects/portal/trunk/app/helpers/application_helper.rb:114)</p>
</blockquote>

<p>The line the warning is on looks like this:</p>

<pre><code>    link_to(name,
            {
              action: action_name,
              params: params.merge({ order: key, page: nil })
            },
            {
              title: "Sort by this field",
            }) +
</code></pre>

<p>As you can see, I'm not calling <code>to_hash</code>. Maybe Rails is. Maybe some other gem is. I have no way to tell, because they didn't think it was worth providing a stack trace. (Pro tip - it usually <em>is</em> worth providing a stack trace!)</p>

<p>So anyway, I followed the link, planning to find a replacement, and <a href="http://api.rubyonrails.org/v5.0.0/classes/ActionController/Parameters.html#method-i-merge" rel="noreferrer">the <code>merge</code> method does not <em>appear</em> to be deprecated</a>, but maybe they simply forgot to document deprecated status, so I can't really be sure.</p>

<p>So what am I supposed to do to clear this?</p>
