title: How to check if a user has voted before 24hrs rails 4
body: <p>I need to check whether the user has voted before 24 hours if yes I need to allow him to vote</p>
  
  <pre><code>if current_user.vote = true
    if @vote.updated_at &gt; Time.now - 24.hours          
      @vote.save          
    end
  end
  </code></pre>
  
  <p>but I am getting error as
  <strong>undefined method `>' for nil:NilClass</strong>
  So how can I fix this?</p>