- <% if @entries.any? %>
+ <% if @entries&.any? %>
@@ -40,8 +52,8 @@
<% else %>
No data available
-
Check back later for today's results!
+
Check back later for <%= @period_type == :weekly ? "this week's" : "today's" %> results!
<% end %>
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/config/initializers/good_job.rb b/config/initializers/good_job.rb
index 02d8b6a..f71dc9d 100644
--- a/config/initializers/good_job.rb
+++ b/config/initializers/good_job.rb
@@ -8,9 +8,15 @@ Rails.application.configure do
cron: "*/5 * * * *",
class: "UserSlackStatusUpdateJob"
},
- leaderboard_update: {
- cron: "*/5 * * * *",
- class: "LeaderboardUpdateJob"
+ daily_leaderboard_update: {
+ cron: "0 0 * * *",
+ class: "LeaderboardUpdateJob",
+ args: [-> { Date.current.to_s }, "daily"]
+ },
+ weekly_leaderboard_update: {
+ cron: "0 0 * * 1",
+ class: "LeaderboardUpdateJob",
+ args: [-> { Date.current.beginning_of_week.to_s }, "weekly"]
},
sailors_log_poll: {
cron: "* * * * *",
@@ -21,4 +27,4 @@ Rails.application.configure do
class: "SlackCommand::UpdateSlackChannelCacheJob"
}
}
-end
+end
\ No newline at end of file
diff --git a/db/schema.rb b/db/schema.rb
index dba770d..552a4bf 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -170,6 +170,13 @@ ActiveRecord::Schema[8.0].define(version: 2025_03_13_205725) do
t.datetime "updated_at", null: false
t.datetime "finished_generating_at"
t.datetime "deleted_at"
+ t.integer "period_type", default: 0, null: false
+ end
+
+ create_table "project_labels", id: :serial, force: :cascade do |t|
+ t.text "user_id"
+ t.text "project_key"
+ t.text "label"
end
create_table "project_repo_mappings", force: :cascade do |t|