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.
我试图在达到保存日期后使文章过期,即:
@articles = Article.where(:semiretirement => Date.today)
我知道那行不通,但是我将如何写after而不是等于?
after
干杯!
怎么样:
@articles = Article.where('semiretirement <= ?', Date.today)
这将找到semiretirement日期小于今天日期的所有文章。我相信这将是您想要使已过给定日期的文章过期的原因。
semiretirement