-
Notifications
You must be signed in to change notification settings - Fork 21.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Gracefully degrade when
ActionMailer::Base#params
is nil
Prior to this change, access to `params` on `ActionMailer::Base` instances prior to being decorated by `ActionMailer::Parameterized.with` calls results in a `NoMethodError`: ``` Error: ParameterizedTest#test_degrade_gracefully_when_.with_is_not_called: NoMethodError: undefined method `[]' for nil:NilClass before_action { @Inviter, @invitee = params[:inviter], params[:invitee] } ^^^^^^^^^^ ``` This change modifies the `attr_accessor :params` to be an `attr_writer` paired with a `params` method that assigns `@params` to an empty `Hash` whenever it's accessed without being otherwise initialized.
- Loading branch information
1 parent
6bace37
commit 6fea9a0
Showing
3 changed files
with
16 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters