mirror of
https://github.com/Evolix/chexpire.git
synced 2024-05-03 01:10:50 +02:00
return the number of whole days
This commit is contained in:
parent
8534a5d351
commit
54e57f20ae
|
@ -82,7 +82,8 @@ class Check < ApplicationRecord
|
||||||
def days_from_last_success
|
def days_from_last_success
|
||||||
return unless last_success_at.present?
|
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
|
end
|
||||||
|
|
||||||
def increment_consecutive_failures!
|
def increment_consecutive_failures!
|
||||||
|
|
Loading…
Reference in a new issue