title: Getting unexpected ',', expecting => ban error
body: <p>I'm getting this error from Ruby:</p>
  
  <blockquote>
    <p>`syntax error, unexpected ',', expecting => ban = Ban.where(:banned => 1, expires &lt; ?", current_time) ^</p>
  </blockquote>
  
  <p>I also get this error:</p>
  
  <blockquote>
    <p><code>undefined method 'expires' for #&lt;Ban::ActiveRecord_Relation</code> if I remove the <code>:banned =&gt; 1,</code></p>
  </blockquote>
  
  <p>This is my code:</p>
  
  <pre><code>class Ban &lt; ActiveRecord::Base
    before_create :unban
    def unban
      puts "starting unban"
      current_time = Time.now
      puts current_time
      ban = Ban.where(:banned =&gt; 1, "expires &lt; ?", current_time)
      if current_time &gt; ban.expires
        ban.update_attributes(:banned =&gt; 0)
        puts "worked"
      end
    end
  end
  </code></pre>