Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing incompatibilities caused by Rails 6 #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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