-
Notifications
You must be signed in to change notification settings - Fork 897
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
Validate bools with inclusion #18914
Validate bools with inclusion #18914
Conversation
@miq-bot add_label bug |
947ceb9
to
76aed49
Compare
@bdunne please review |
76aed49
to
65e367a
Compare
@jrafanie any chance you want to review please? |
@bdunne sorry but could i get you to re-re-re-review please? |
@@ -30,7 +30,7 @@ class DialogField < ApplicationRecord | |||
|
|||
default_value_for :required, false | |||
default_value_for(:visible) { true } | |||
validates :visible, :presence => true | |||
validates :visible, inclusion: { in: [ true, false ] } |
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.
👍
@miq-bot add_label hammer/yes |
@d-m-u #18778 isn't in hammer branch and backporting this PR conflicts. diff --cc app/models/dialog_field.rb
index e78ac49364,8b87d46f0c..0000000000
--- a/app/models/dialog_field.rb
+++ b/app/models/dialog_field.rb
@@@ -29,7 -29,9 +29,13 @@@ class DialogField < ApplicationRecor
:message => "Field Name %{value} is reserved."}
default_value_for :required, false
++<<<<<<< HEAD
+ default_value_for(:visible, :allows_nil => false) { true }
++=======
+ default_value_for(:visible) { true }
+ validates :visible, inclusion: { in: [ true, false ] }
+ default_value_for :load_values_on_init, true
++>>>>>>> 36676ab875... Merge pull request #18914 from d-m-u/fixing_dialog_field_visible_validation |
... since the presence fails because false.blank? => true
https://bugzilla.redhat.com/show_bug.cgi?id=1720608