Nothing Special   »   [go: up one dir, main page]

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

Fixes #38044 - Don't accept negative values for OS major version #10388

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

Conversation

girijaasoni
Copy link
Contributor

No description provided.

@@ -22,7 +22,7 @@ class Operatingsystem < ApplicationRecord
accepts_nested_attributes_for :os_default_templates, :allow_destroy => true,
:reject_if => :reject_empty_provisioning_template

validates :major, numericality: true, presence: { message: N_("Operating System version is required") }
validates :major, numericality: {:greater_than_or_equal_to => 0, :message => N_("Major version should be greater than or equal to 0") }, presence: { message: N_("Operating System version is required") }
Copy link
@Lennonka Lennonka Nov 26, 2024

Choose a reason for hiding this comment

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

Suggested change
validates :major, numericality: {:greater_than_or_equal_to => 0, :message => N_("Major version should be greater than or equal to 0") }, presence: { message: N_("Operating System version is required") }
validates :major, numericality: {:greater_than_or_equal_to => 0, :message => N_("Major version of the operating system must be greater than or equal to 0") }, presence: { message: N_("Operating System version is required") }

I'm not sure what the context for this text is, but I'd include the words "operating system". Also, it's a hard requirement, so "must".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

addressed

@girijaasoni girijaasoni changed the title Fixes - 38044 - Don't accept negative values for OS major version Fixes #38044 - Don't accept negative values for OS major version Nov 27, 2024
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