I have an app that is supposed to expire items based on a comparison of
the expiration date of the item and the current date. So if expiration
date < current date, I do not want to display the item. Rails seems to
be caching something, because the variable I set for the current date is
from a few days back - when I restart mongrel it must release the cache
because it expires my items as it should. Here is what I have in my
controller:
def list_items
today = Time.now.beginning_of_day.to_date.strftime("%Y-%m-%d")
@items = Item.find(:all,:conditions => “expiration>=’#{today}’”)
end
How can I stop rails from caching @today?