title: find_by NoMethodError in Rails
body: <p>I have the following line of code,</p>
  
  <pre><code>user = User.find_by(email: params[:session][:email].downcase)
  </code></pre>
  
  <p>That is throwing an error</p>
  
  <pre><code>NoMethodError in SessionsController#create
  
  undefined method `find_by' for #&lt;Class:0x007f67187ef730&gt;
  
  Rails.root: /home/dj/portfolio/sample_app
  Application Trace | Framework Trace | Full Trace
  
  app/controllers/sessions_controller.rb:7:in `create'
  </code></pre>
  
  <p>In other parts of the code I have successfully used <code>find_by_email</code> with no error. What could be causing this method to not work?</p>