From c1f29b8da4bdb3cc37c9aa8d033863e22e84df98 Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Tue, 21 Apr 2020 16:40:58 -0500 Subject: [PATCH] add rake task for creating initial notifications --- lib/tasks/one_off.rake | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 lib/tasks/one_off.rake diff --git a/lib/tasks/one_off.rake b/lib/tasks/one_off.rake new file mode 100644 index 00000000..f6ae25de --- /dev/null +++ b/lib/tasks/one_off.rake @@ -0,0 +1,14 @@ +namespace :one_off do + desc "Create a notification for all users telling them about the new notifications" + task notifications_announcement: :environment do + User.all.find_each do |user| + user.notifications.create( + message_html: '
A new feature is now available:
Notifications on Notebook.ai
', + icon: 'favorite', + icon_color: 'red', + happened_at: DateTime.current, + passthrough_link: 'TODO' + ) + end + end +end