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

[Validator/Matcher] Add new total_size validator and associated matcher (#113) #252

Conversation

Mth0158
Copy link
Collaborator

@Mth0158 Mth0158 commented Jul 4, 2024

  • Implement base validator
  • Add validator matcher
  • Implementing corresponding tests
  • Add translations
  • Update readme

@Mth0158 Mth0158 linked an issue Jul 4, 2024 that may be closed by this pull request
@Mth0158 Mth0158 force-pushed the 113-validate-total-size-of-attachments-in-case-of-has_many-relationship branch 2 times, most recently from 2678205 to 5c9d763 Compare July 5, 2024 08:53
@Mth0158 Mth0158 force-pushed the 113-validate-total-size-of-attachments-in-case-of-has_many-relationship branch from 5c9d763 to f9a573e Compare July 5, 2024 08:59
@Mth0158
Copy link
Collaborator Author

Mth0158 commented Jul 5, 2024

@igorkasyanchuk & @gr8bit what do you think of this PR?
As mentioned in #113, I have added a new validator to the gem: the total_size validator, which goal is to validate the total file size of a has_many_attached relation.
I have undergone a refacto of the SizeValidator / SizeValidatorMatcher classes in order to stay as DRY as possible, it feels ok to me. Hopefully we do not have regressions thanks to the test suite that is pretty dense now! :)

@Mth0158 Mth0158 requested review from gr8bit and igorkasyanchuk July 5, 2024 09:03
@Mth0158 Mth0158 merged commit 0f47f18 into master Sep 4, 2024
40 checks passed
@Mth0158 Mth0158 deleted the 113-validate-total-size-of-attachments-in-case-of-has_many-relationship branch September 4, 2024 10:29
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.

Validate total size of attachments in case of has_many relationship
2 participants