Browse Source

return the number of whole days

rails6
Jérémy Lecour 1 year ago
parent
commit
54e57f20ae
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      app/models/check.rb

+ 2
- 1
app/models/check.rb View File

@ -82,7 +82,8 @@ class Check < ApplicationRecord
def days_from_last_success
return unless last_success_at.present?
(Date.today - last_success_at.to_date).to_i
# return the number of whole days
((Time.now - last_success_at) / (24 * 3600)).to_i
end
def increment_consecutive_failures!


Loading…
Cancel
Save