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

ensure options on validations are passed into errors #232

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JoshDevs
Copy link

This PR ensures that the options that are sent in the validation are passed through to errors.

Custom options being set on a validation should be able to be accessed post validation as they would have been set to indicate a validation has failed for some reason.

Added a test case that checks for this.

@TastyPi
Copy link
Contributor

TastyPi commented Jun 22, 2023

@adzap Hi, this is a minor patch we've made to validates_timeliness. It makes the library more consistent with the standard Rails validators, as they all include **options when adding an error, e.g. PresenceValidator.

We'd like to get this merged upstream so we don't have to maintain our own fork, could you take a look?

@tagliala
Copy link
Contributor

tagliala commented Jan 4, 2024

Hi, I've asked to be added to maintainers so I can keep this library up to date and merge bug fixes like this. Let's maybe wait but at a certain point I'm interested in creating a fork maybe in a new GitHub team to allow multiple admins

@TastyPi
Copy link
Contributor

TastyPi commented Jul 29, 2024

@tagliala any update on this?

@tagliala
Copy link
Contributor

Please migrate to Rails' built in comparison validator, this gem is not maintained and probably not needed anymore

diowa/icare@dd4a467#diff-8f06df7d19040b42d0ab94249895f10fac375834ce5a6f4e55b93570b9dd7d8fL26-R27

@TastyPi
Copy link
Contributor

TastyPi commented Jul 30, 2024

@tagliala we use this gem to check that the correct date format was provided in order to prevent mm-dd-yyyy vs dd-mm-yyyy issues from data we get from clients. We probably don't need to anymore, but that is a use case the Rails validators do not provide. Admittedly it doesn't guarantee we were provided with the right format e.g. 01-02-2024 is ambiguous, but it was an extra feature this gem has that Rails doesn't.

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.

3 participants