Skip to content

Instantly share code, notes, and snippets.

@r38y
Created October 31, 2012 17:02
Show Gist options
  • Save r38y/3988312 to your computer and use it in GitHub Desktop.
Save r38y/3988312 to your computer and use it in GitHub Desktop.
module Dms
def self.last_checked_at
value = Setting.get('last_checked_at')
Time.parse(value) if value
end
def self.checked!
last_checked_at = Time.now.utc
Setting.set('last_checked_at', last_checked_at)
end
def self.potential_problem_text
runs = ((Time.now - Dms.last_checked_at) / 60 / 62).to_i
"#{runs} potential problems"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment