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

Added ability to add format to model attribute error key #45471

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

Conversation

ygreeek
Copy link

@ygreeek ygreeek commented Jun 27, 2022

I've added ability to add format to model attribute error key
What problem does it solve?
For example we have following locale.yaml:

company:
  attributes:
    provider:
      already_used_by_other_provider: "Already used by other provider"
      already_registered_by_another_provider: "already registered by another provider"

We want to show full_error of already_used_by_other_provider key as %{message}, but want the already_registered_by_another_provider error key as %{attribute} %{message}

This can now be achieved by declaring the format like this:

company:
  attributes:
    provider:
      already_used_by_other_provider: 
        message: "Already used by other provider"
        format: "%{message}"
      already_registered_by_another_provider: "already registered by another provider"

@ygreeek ygreeek force-pushed the add-ability-to-add-format-to-model-attribute-error-key branch 3 times, most recently from 22aaa03 to 09aef26 Compare June 27, 2022 12:59
@ygreeek ygreeek force-pushed the add-ability-to-add-format-to-model-attribute-error-key branch from 09aef26 to 1e0cee1 Compare June 27, 2022 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant