Skip to content

Commit

Permalink
Merge branch 'main' of github.com:excid3/noticed
Browse files Browse the repository at this point in the history
  • Loading branch information
excid3 committed Jan 9, 2025
2 parents b980d21 + a9bae80 commit 7b56b56
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,14 @@ rails db:migrate
To migrate your data to the new tables, loop through your existing notifications and create new records for each one. You can do this in a Rake task or in the Rails console:

```ruby
# Temporarily define the Notification model to access the old table
class Notification < ActiveRecord::Base
# Temporarily define the model to access the old table
class TempNotification < ActiveRecord::Base
self.inheritance_column = nil
self.table_name = "notifications"
end

# Migrate each record to the new tables
Notification.find_each do |notification|
TempNotification.find_each do |notification|
attributes = notification.attributes.slice("type", "created_at", "updated_at").with_indifferent_access
attributes[:type] = attributes[:type].sub("Notification", "Notifier")
attributes[:params] = Noticed::Coder.load(notification.params)
Expand Down
2 changes: 1 addition & 1 deletion lib/noticed/bulk_delivery_method.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Noticed
class BulkDeliveryMethod < ApplicationJob
class BulkDeliveryMethod < Noticed.parent_class.constantize
include ApiClient
include RequiredOptions

Expand Down

0 comments on commit 7b56b56

Please sign in to comment.