title: Ruby 2 Keyword Arguments and ActionController::Parameters
body: <p>I have a rails 4 application that is running on ruby 2.1. I have a <code>User</code> model that looks something like</p>
  
  <pre><code>class User &lt; ActiveModel::Base
    def self.search(query: false, active: true, **extra)
      # ...
    end
  end
  </code></pre>
  
  <p>As you can see in the search method I am attempting to use the new keyword arguments feature of ruby 2. </p>
  
  <p>The problem is that when I call this code from in my controller all values get dumped into <code>query</code>. </p>
  
  <p><strong>params</strong></p>
  
  <pre><code>{"action"=&gt;"search", "controller"=&gt;"users", query: "foobar" }
  </code></pre>
  
  <p><em>Please note that this is a ActionController::Parameters object and not a hash as it looks</em></p>
  
  <p><strong>UsersController</strong></p>
  
  <pre><code>def search
    @users = User.search(params)
  end
  </code></pre>
  
  <p>I feel that this is because params is a <code>ActionController::Parameters</code> object and not a hash. However even calling <code>to_h</code> on params when passing it in dumps everything into <code>query</code> instead of the expected behavior. I think this is because the keys are now strings instead of symbols. </p>
  
  <p>I know that I could build a new hash w/ symbols as the keys but this seems to be more trouble than it's worth. Ideas? Suggestions?</p>