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

Fix compose inputs #536

Merged
merged 3 commits into from Jul 17, 2022

Conversation

spencersteiner
Copy link
Contributor

While upgrading to active interaction 5.0.0 I found that the inputs must be a hash or ActionController::Parameters argument error is being raised when inputs are composed within an interaction (i.e. compose(Multiply, inputs) ). It looks like that error will be raised unless they are a hash or an ActionController::Parameters instance when we probably want to also allow them to be Inputs for composition.

I wrote two test cases, one for the #normalized method where the error gets raised to make sure it does not when they are of type ActiveInteraction::Inputs and one for the #compose method directly to ensure it is a valid outcome for both a hash or an Inputs instance.

It's my first time reading through the library source, so if I'm missing anything obvious or there is a better way to approach this let me know how I can help!

@AaronLasseigne AaronLasseigne changed the base branch from main to next July 16, 2022 20:16
@AaronLasseigne
Copy link
Owner

Thanks! I noticed a small change but otherwise this looks great. It also made me realize I should probably add the ActiveSupport Hash extension methods to Inputs.

@AaronLasseigne AaronLasseigne merged commit 1b78760 into AaronLasseigne:next Jul 17, 2022
@spencersteiner spencersteiner deleted the fix-compose-inputs branch August 5, 2022 03:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants