-
Notifications
You must be signed in to change notification settings - Fork 32
Cron
Vinicius Stock edited this page Feb 19, 2019
·
1 revision
Sail.set(:my_cron_setting, "0 * * * *")
Sail.get(:my_cron_setting)
=> true
Sail.get(:my_date_setting) do |setting_value|
puts setting_value
end
=> true
Cron settings return true if the current time matches the passed cron expression. This can be used for specific checks in recurring events.
class Entry < ApplicationRecord
.
.
.
def created_at_top_of_the_hour?
Sail.get(:top_of_the_hour_cron)
end
end