Skip to content

Commit

Permalink
Fixing krisleech#29
Browse files Browse the repository at this point in the history
  • Loading branch information
alecslupu authored and pmq20 committed Jan 5, 2021
1 parent 8610a45 commit 6f40986
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/wisper/active_record/publisher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,25 @@ def after_validation_broadcast

def after_create_broadcast
broadcast(:after_create, self)
return unless broadcast_model_name_key
broadcast("create_#{broadcast_model_name_key}_successful", self)
end

def after_update_broadcast
broadcast(:after_update, self)
return unless broadcast_model_name_key
broadcast("update_#{broadcast_model_name_key}_successful", self)
end

def after_destroy_broadcast
broadcast(:after_destroy, self)
return unless broadcast_model_name_key
broadcast("destroy_#{broadcast_model_name_key}_successful", self)
end

def after_commit_broadcast
broadcast(:after_commit, self)
return unless broadcast_model_name_key
broadcast("#{broadcast_model_name_key}_committed", self)
end

Expand All @@ -48,7 +52,7 @@ def after_rollback_broadcast
end

def broadcast_model_name_key
self.class.model_name.param_key
self.class.model_name.param_key rescue false
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/wisper/active_record/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Wisper
module ActiveRecord
VERSION = "1.0.0"
VERSION = "1.0.1"
end
end

0 comments on commit 6f40986

Please sign in to comment.