Skip to content

Add requireness to HasOne form#2812

Merged
pablobm merged 2 commits intothoughtbot:mainfrom
goosys:fix-has_one-requireness
Mar 6, 2026
Merged

Add requireness to HasOne form#2812
pablobm merged 2 commits intothoughtbot:mainfrom
goosys:fix-has_one-requireness

Conversation

@goosys
Copy link
Copy Markdown
Contributor

@goosys goosys commented Mar 17, 2025

The nested form for HasOne didn't have the requiredness mark, so I added it.

Before:

image

After:

image

@nickcharlton
Copy link
Copy Markdown
Member

Can you think of a reasonable way to test this, so we don't break it in future?

@goosys
Copy link
Copy Markdown
Contributor Author

goosys commented Mar 20, 2025

I will think of a reasonable way to test this and add it!

@goosys
Copy link
Copy Markdown
Contributor Author

goosys commented Mar 24, 2025

I've added tests.

By the way, ProductoMetaTag is the only place in the demo app that uses Field::HasOne, but it has too few columns, both of which are String type and required. This makes it less suitable for comprehensive testing.

Would you consider adding more columns?

@goosys
Copy link
Copy Markdown
Contributor Author

goosys commented Mar 24, 2025

Regarding this method name, is "requireness" correct? Should it be "requiredness" instead?

@nickcharlton
Copy link
Copy Markdown
Member

By the way, ProductoMetaTag is the only place in the demo app that uses Field::HasOne, but it has too few columns, both of which are String type and required. This makes it less suitable for comprehensive testing.

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.

Regarding this method name, is "requireness" correct? Should it be "requiredness" instead?

I think "requiredness" is likely more correct, according to the OED it is a word, although not a common one.

@goosys goosys force-pushed the fix-has_one-requireness branch from db181cc to 0d833b1 Compare March 27, 2025 05:43
@goosys
Copy link
Copy Markdown
Contributor Author

goosys commented Mar 27, 2025

Rebased!

@goosys goosys force-pushed the fix-has_one-requireness branch from 0d833b1 to e50a6e4 Compare March 4, 2026 04:51
@goosys
Copy link
Copy Markdown
Contributor Author

goosys commented Mar 4, 2026

Rebased.

@pablobm
Copy link
Copy Markdown
Collaborator

pablobm commented Mar 6, 2026

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.

For a while now I've been thinking that ideally we should have several example apps, or one with several admin interfaces handling unrelated models (or perhaps related). I feel that trying to get every single use case with a single app gets out of hand pretty quickly.

@pablobm
Copy link
Copy Markdown
Collaborator

pablobm commented Mar 6, 2026

I think this is good :shipit:

@pablobm pablobm merged commit ebbe215 into thoughtbot:main Mar 6, 2026
30 checks passed
@goosys
Copy link
Copy Markdown
Contributor Author

goosys commented Mar 7, 2026

What do you think about moving this into a separate dedicated repository?

Something like administrate-kitchensink or administrate-storybook. Ideally, I’d like it to have all the community plugins installed, and include many examples using looks.

For example, we could provide multiple implementations for Field::Date, such as a react-daterange-picker version, a stimulus-flatpickr version, and a jquery-date-range-picker version, each implemented using looks. We could also add various examples for other Fields as well.

I think this would help users get a better sense of how things can be used in practice, and also serve as a reference for implementation.

In an ideal world, it could become a place where we can easily try out Fields built on top of minor gems just to see how they feel.

Just a thought.

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.

3 participants