Skip to content

Conversation

balvig
Copy link
Contributor

@balvig balvig commented Feb 21, 2022

What

Allows invalid? and validate! methods from ActiveModel::Validations to work.

Why

Due to the overridden valid? method not taking into account the save context feature from more recent versions of ActiveModel, without this change, using those methods will raise:

ArgumentError: wrong number of arguments (given 1, expected 0)

How

Simply adds the (context = nil) argument to the method signature of valid?.

@rafaelfranca rafaelfranca merged commit 9dfc15e into rails:main Feb 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants