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

213 incorrect error message when validator is used with if or on #214

Conversation

Mth0158
Copy link
Collaborator

@Mth0158 Mth0158 commented Nov 12, 2023

Thanks to the work done in #209

Again, a "big" one, but it's mostly refacto the validator test suite. Only 2 prod files are impacted:

  • lib/active_storage_validations/limit_validator.rb => We do not take into account the attached files without blob when counting for validating, @igorkasyanchuk I had to do this to pass the tests with context option, I think this was an edge case? Or is this something that I get wrong?
  • lib/active_storage_validations/size_validator.rb => We make sure not to take Rails options as key interpolated for i18n

@Mth0158
Copy link
Collaborator Author

Mth0158 commented Nov 12, 2023

It's in draft because it's missing the if option, I'll finish this part soon!

@Mth0158 Mth0158 marked this pull request as draft November 12, 2023 12:56
@Mth0158 Mth0158 force-pushed the 213-incorrect-error-message-when-validator-is-used-with-if-or-on branch from bd941e9 to 16dc799 Compare November 12, 2023 14:28
@Mth0158 Mth0158 marked this pull request as ready for review November 12, 2023 15:38
@Mth0158 Mth0158 force-pushed the 213-incorrect-error-message-when-validator-is-used-with-if-or-on branch from a899539 to 6baac5c Compare November 13, 2023 13:43
@Mth0158
Copy link
Collaborator Author

Mth0158 commented Nov 13, 2023

@igorkasyanchuk I took the liberty to merge this PR since it only impacts lightly 2 prod files. This PR sets the base for the next test files that will greatly enhance our ability to mitigate regressions :)
Let me know if I overstepped, I'll let you do the release

@Mth0158 Mth0158 merged commit c855029 into igorkasyanchuk:master Nov 13, 2023
26 checks passed
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.

1 participant