-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 requireness to HasOne form #2812
base: main
Are you sure you want to change the base?
Conversation
Can you think of a reasonable way to test this, so we don't break it in future? |
I will think of a reasonable way to test this and add it! |
I've added tests. By the way, Would you consider adding more columns? |
Regarding this method name, is "requireness" correct? Should it be "requiredness" instead? |
We should add more if it's needed for testing. The demo app has grown organically and is neither consistent nor coherent in how it works. I've long wanted to switch the demo app to follow a particular pattern. Maybe a shop or something.
I think "requiredness" is likely more correct, according to the OED it is a word, although not a common one. |
db181cc
to
0d833b1
Compare
Rebased! |
@@ -27,7 +27,7 @@ The form will be rendered as nested_from to parent relationship. | |||
<% end %> | |||
|
|||
<% attributes.each do |attribute| %> | |||
<div class="field-unit field-unit--<%= attribute.html_class %>"> | |||
<div class="field-unit field-unit--<%= attribute.html_class %> field-unit--<%= requireness(attribute) %>"> |
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.
<div class="field-unit field-unit--<%= attribute.html_class %> field-unit--<%= requireness(attribute) %>"> | |
<div class="field-unit field-unit--<%= attribute.html_class %> field-unit--<%= requiredness(attribute) %>"> |
I think we should probably make the change to "requiredness", as I do think that's more correct than "requireness".
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.
Should this be changed in this PR?
Or would it be okay if I open a new PR?
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.
Oh! Right, it's not actually introduced here. I hadn't realised. Let's leave it for now, we've already got the existing name and it's fine.
The nested form for HasOne didn't have the requiredness mark, so I added it.
Before:
After: