Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我知道我可以使用范围来搜索日期位于两个日期之间的位置。例如:
User.where(:created_at => start_date..end_date )
但是,我将如何对日期之前或之后的所有日期进行开放式搜索?
谢谢你的帮助
你可以简单地这样做:
User.where("created_at >= ?", start_date )
或这个
User.where("created_at <= ?", end_date )