-
Notifications
You must be signed in to change notification settings - Fork 898
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
Adds unique within region check to pxe image type names #16745
Conversation
163dd91
to
2220847
Compare
app/models/pxe_image_type.rb
Outdated
@@ -4,7 +4,7 @@ class PxeImageType < ApplicationRecord | |||
has_many :windows_images | |||
has_many :iso_images | |||
|
|||
validates_uniqueness_of :name | |||
validates_uniqueness_of :name, :unique_within_region => true, :message => "Pxe Image Type name (%{value}) has already been taken" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was there a problem with the default message?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely, it doesn't distinguish between the pxe_image_type name and the name of the customization_template.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
5d9e7d5
to
f657018
Compare
f657018
to
130f087
Compare
Checked commit d-m-u@130f087 with ruby 2.3.3, rubocop 0.52.0, haml-lint 0.20.0, and yamllint 1.10.0 |
I'm pretty sure these template names should be unique by region.
#16739 led me to this issue.