@messages = current_user.message_participantions.where(:read => false, :updated_at > 5.days.ago)
The updated_at 5 days ago errors. Do I need to use a format like so:
find(:all, :conditions => ["created_at > ?", 5.days.ago])
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could do:
@messages = current_user.message_participantions.where("read = ? AND updated_at > ?", false, 5.days.ago)Or if for some reason you need to use the hash:
@messages = current_user.message_participantions.where(:read => false, :updated_at => 5.days.ago..Time.now)As the values of the hash argument to the where method can be exact values or ranges: http://api.rubyonrails.org/classes/ActiveRecord/Base.html