Close votes automatically after 7 days

Closes #1
This commit is contained in:
ricola 2025-06-08 15:57:26 -06:00
parent cac94c2379
commit b41a0d0417
14 changed files with 284 additions and 97 deletions

View file

@ -0,0 +1,8 @@
set :admin_email, 'vedia@potager.org'
set :values, [ { :id => 1, :label => _("Awful"), :color => '#ff4500' },
{ :id => 2, :label => _("Very bad"), :color => '#ffa500' },
{ :id => 3, :label => _("Bad"), :color => '#ffff00' },
{ :id => 4, :label => _("Mediocre"), :color => '#9acd32' },
{ :id => 5, :label => _("Good"), :color => '#228b22' },
{ :id => 6, :label => _("Very good"), :color => '#006400' } ]
set :expire_after, 7 * 24 * 60 * 60 # 7 days

9
config/schedule.rb Normal file
View file

@ -0,0 +1,9 @@
if ENV['RAILS_ENV']
set :environment, ENV['RAILS_ENV']
end
set :output, 'vedia.log'
every 5.minutes do
rake "close_expired_votes"
end