Yesterday, I said goodbye to a dear friend.
I will remember him for the joy, and for the good times.
love you, Shay!
Look over us.
Tuesday, November 30, 2010
Thursday, November 11, 2010
Rails Application variable II
Ah, it turns out that my heist and ignorance in Ruby and Rails I missed out on the Rails.cache options.
All you need is...
def self.alive? (id)
if Rails.cache.read(id)!=nil and (Time.now - Rails.cache.read(id))<10
true
else
Rails.cache.delete(id)
false
end
end
def self.present(id)
Rails.cache.write(id,Time.now)
end
(...love)
All you need is...
def self.alive? (id)
if Rails.cache.read(id)!=nil and (Time.now - Rails.cache.read(id))<10
true
else
Rails.cache.delete(id)
false
end
end
def self.present(id)
Rails.cache.write(id,Time.now)
end
(...love)
Subscribe to:
Posts (Atom)