Skip to content

Commit 91547b8

Browse files
committed
Use public methods only when calling mailers. Fixes #457
1 parent b1148c4 commit 91547b8

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
### Unreleased
22

3+
* Use `public_send` for Email delivery so it doesn't accidentally call private methods.
4+
35
### 2.3.2
46

57
* Set `:json` type on `:params` column with default to better integrate with ActiveRecord.

lib/noticed/delivery_methods/email.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def deliver
77
mailer = fetch_constant(:mailer)
88
email = evaluate_option(:method)
99
args = evaluate_option(:args) || []
10-
mail = mailer.with(params).send(email, *args)
10+
mail = mailer.with(params).public_send(email, *args)
1111
(!!evaluate_option(:enqueue)) ? mail.deliver_later : mail.deliver_now
1212
end
1313

0 commit comments

Comments
 (0)