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

Add validation of more article fields #917

Merged
merged 1 commit into from
Jan 26, 2022
Merged

Conversation

kidhab
Copy link
Contributor

@kidhab kidhab commented Jan 24, 2022

If one adds a some text that is longer than 255 characters into these articles fields the browser shows an unspecific error messages. With this validation an understandable message will be shown.

If one adds a some text  that is longer than 255 characters into these articles fields the browser shows an unspecific error messages. With this validation an understandable message will be shown.
@kidhab
Copy link
Contributor Author

kidhab commented Jan 25, 2022

Let me know if you prefer grouping of the fields like:

validates_length_of :note, :origin, :manufacturer, :order_number, :maximum => 255

Copy link
Member

@wvengen wvengen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, useful!

@wvengen
Copy link
Member

wvengen commented Jan 26, 2022

With migrating to higher Rails versions, I'd consider moving the use of validates, one line per attribute.

@wvengen wvengen merged commit 7574f4e into foodcoops:master Jan 26, 2022
@kidhab kidhab deleted the patch-6 branch May 16, 2023 06:58
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