diff --git a/app/models/noticed/deliverable/deliver_by.rb b/app/models/noticed/deliverable/deliver_by.rb index 3fab822..2185f21 100644 --- a/app/models/noticed/deliverable/deliver_by.rb +++ b/app/models/noticed/deliverable/deliver_by.rb @@ -32,7 +32,7 @@ def evaluate_option(name, context) if option.respond_to?(:call) context.instance_exec(&option) - elsif option.is_a?(Symbol) && context.respond_to?(option) + elsif option.is_a?(Symbol) && context.respond_to?(option, true) context.send(option) else option diff --git a/lib/noticed/bulk_delivery_method.rb b/lib/noticed/bulk_delivery_method.rb index 9a7f312..4ba1591 100644 --- a/lib/noticed/bulk_delivery_method.rb +++ b/lib/noticed/bulk_delivery_method.rb @@ -40,7 +40,7 @@ def evaluate_option(name) event.instance_exec(&option) # Call method if symbol and matching method - elsif option.is_a?(Symbol) && event.respond_to?(option) + elsif option.is_a?(Symbol) && event.respond_to?(option, true) event.send(option) # Return the value diff --git a/lib/noticed/delivery_method.rb b/lib/noticed/delivery_method.rb index 20e747d..bf32e17 100644 --- a/lib/noticed/delivery_method.rb +++ b/lib/noticed/delivery_method.rb @@ -50,7 +50,7 @@ def evaluate_option(name) notification.instance_exec(&option) # Call method if symbol and matching method on Notifier - elsif option.is_a?(Symbol) && event.respond_to?(option) + elsif option.is_a?(Symbol) && event.respond_to?(option, true) event.send(option, notification) # Return the value diff --git a/lib/noticed/delivery_methods/fcm.rb b/lib/noticed/delivery_methods/fcm.rb index 99ad60c..9787907 100644 --- a/lib/noticed/delivery_methods/fcm.rb +++ b/lib/noticed/delivery_methods/fcm.rb @@ -25,7 +25,7 @@ def send_notification(device_token) def format_notification(device_token) method = config[:json] - if method.is_a?(Symbol) && event.respond_to?(method) + if method.is_a?(Symbol) && event.respond_to?(method, true) event.send(method, device_token) else notification.instance_exec(device_token, &method) diff --git a/lib/noticed/delivery_methods/ios.rb b/lib/noticed/delivery_methods/ios.rb index 551d342..9ea27e7 100644 --- a/lib/noticed/delivery_methods/ios.rb +++ b/lib/noticed/delivery_methods/ios.rb @@ -34,7 +34,7 @@ def format_notification(apn) method = config[:format] # Call method on Notifier if defined - if method&.is_a?(Symbol) && event.respond_to?(method) + if method&.is_a?(Symbol) && event.respond_to?(method, true) event.send(method, notification, apn) # If Proc, evaluate it on the Notification elsif method&.respond_to?(:call)