title: Why does comparing created_at to the current Date cause an error?
body: <p>I'm trying to use "if statement" that's comparing <code>created_at</code> of last posted comment's with today.</p>
  
  <p>However this returns error:</p>
  
  <p><strong>Application helper</strong></p>
  
  <pre><code>def chat_button(community)
    if community.comments.last.created_at == Date.current.to_date
      'Posted today'
    else
      'No post today'
    end
  end
  </code></pre>