Skip to content

Commit

Permalink
Change before_destroy callback on box to after_destroy callback
Browse files Browse the repository at this point in the history
  • Loading branch information
luciajanikova committed Nov 14, 2023
1 parent ff84170 commit 7dce64f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/box.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Box < ApplicationRecord
has_many :message_drafts_imports, dependent: :destroy
has_many :automation_conditions, as: :condition_object

before_destroy ->(box) { EventBus.publish(:box_destroyed, box.id, box.api_connection_id) }
after_destroy ->(box) { EventBus.publish(:box_destroyed, box.id, box.api_connection_id) }

before_create { self.color = Box.colors.keys[name.hash % Box.colors.size] if color.blank? }

Expand Down

0 comments on commit 7dce64f

Please sign in to comment.