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

Allow dynamic error message via Proc or Lambda #221

Merged
merged 1 commit into from
Oct 3, 2023

Conversation

franee
Copy link
Contributor

@franee franee commented Oct 3, 2023

Makes it possible to have a dynamic error message like:

class SomeForm
  include ActiveModel::Model

  validates :email, 'valid_email_2/email' => {
    mx:         true,
    blacklist:  true,
    disposable: true,
    message:    -> { I18n.t('errors.registration.disposible_email') }
  }
end

@micke micke merged commit fe74f18 into micke:master Oct 3, 2023
11 checks passed
@micke
Copy link
Owner

micke commented Oct 3, 2023

Thanks! I've released version 5.1.0 with this!

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