我正在研究使用Ice Cube https://github.com/seejohnrun/ice_cube進行重複性事件。 我的問題是,如果我然後需要得到在給定時間段內(例如,在一天或一週內)的任何事件,是否有任何更好的方式比循環遍歷它們都是這樣的:在給定時間段內有效檢索ice_cube計劃
items = Records.find(:all)
items.each do |item|
schedule = item.schedule
if schedule.occurs_on?(Date.new)
#if today is a recurrence, add to array
end
end
這看起來可怕的效率很低,但我不知道該如何去做。
你最終做了什麼?即時通訊卡在同一個地方嗎?謝謝 – loloso