Hi there,
I know the following model code is not correct: as models get loaded only on server boot, time "constants" are loaded at that time only, too.
class Article < ActiveRecord::Base
def expiring?
if (self.enddate - Time.now) <= 1.day
true
else
false
end
end
end
What do I have to correct how, so that the time values get evaluated everytime "expiring?" is called?
Thanks for your help!
Tom