add rake task for creating initial notifications

This commit is contained in:
Andrew Brown 2020-04-21 16:40:58 -05:00
parent a9272c3813
commit c1f29b8da4

14
lib/tasks/one_off.rake Normal file
View File

@ -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: '<div>A new feature is now available:</div><div class="blue-text text-darken-3">Notifications on Notebook.ai</div>',
icon: 'favorite',
icon_color: 'red',
happened_at: DateTime.current,
passthrough_link: 'TODO'
)
end
end
end