How can I check if a row was updated today? updated_at is saying it is Jan 07 and Date.today is saying it is Jan 06.
The code below evaluates to false for a few hours a day for a row that was created milliseconds ago.
up_votes.where(:post_id => params[:post_id]).order('updated_at DESC').limit(1).first.updated_at.to_date == Date.today
Am I correct using Date.today in a controller to compare against active record timestamps?
Can not you just use
today?()function of the api? http://api.rubyonrails.org/classes/Date.html#method-i-today-3F