I have an event model which has start_at of type datetime. How can I search to find if there is an Event left for today, so start_at between now and midnight.
Thanks
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.
In Rails 3, you can do this now:
So in your case it would be:
Just tested and it also works without parentheses around
Time.zone.nowandTime.zone.now.end_of_day.(From Rails Guides)