Skip to content

Conversation

jonathanhefner
Copy link
Member

In #45752, a :params kwarg was added to assert_enqueued_email_with so that mailer params and args could be specified simultaneously. However, for backward compatibility, the old behavior of treating an :args Hash as params was preserved. The result is that if both :params and :args are specified and :args is a Hash, :params is ignored.

This commit deprecates specifying params via :args (i.e. passing a Hash to :args).

After the deprecated behavior is removed, it will be possible to pass a Hash to :args, and the Hash will be treated as named args instead.

In rails#45752, a `:params` kwarg was added to `assert_enqueued_email_with`
so that mailer params and args could be specified simultaneously.
However, for backward compatibility, the old behavior of treating an
`:args` Hash as params was preserved.  The result is that if both
`:params` and `:args` are specified and `:args` is a Hash, `:params` is
ignored.

This commit deprecates specifying params via `:args` (i.e. passing a
Hash to `:args`).

After the deprecated behavior is removed, it will be possible to pass
a Hash to `:args`, and the Hash will be treated as named args instead.
@jonathanhefner jonathanhefner force-pushed the assert_enqueued_email_with-deprecate-params-via-args branch from a2564f1 to 19df946 Compare May 11, 2023 19:11
@jonathanhefner jonathanhefner merged commit fc9470a into rails:main May 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant