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

Allow Blank Contexts in (Radiocarbon/Dendro) Date Form? #384

Open
MartinHinz opened this issue Feb 4, 2025 · 2 comments
Open

Allow Blank Contexts in (Radiocarbon/Dendro) Date Form? #384

MartinHinz opened this issue Feb 4, 2025 · 2 comments

Comments

@MartinHinz
Copy link
Collaborator

In the modal form for editing a radiocarbon date, I am unable to save the date unless I provide an arbitrary context name. I am not sure if this is a bug or intended behavior, but given that most of our current data has blank contexts, we should consider allowing empty contexts.

Proposed Solutions

  • Allow blank contexts in the form by removing the validation requirement.
  • If we decide that context names should remain mandatory, we should revisit whether this aligns with our dataset and workflow.

Relevant Code
Currently, the context model enforces:

validates :name, presence: true

If we want to allow blank contexts, we should remove or modify this validation.

Next Steps
@joeroe, what do you think? Should we enable blank contexts or enforce names consistently?

Side note
This is only relevant currently for Radiocarbon dates, since due to the importer the test data for dendro all come with a specified context.

@MartinHinz MartinHinz changed the title Allow Blank Contexts in (Radiocarbon/Dendro) Date Form Allow Blank Contexts in (Radiocarbon/Dendro) Date Form? Feb 4, 2025
@joeroe
Copy link
Contributor

joeroe commented Feb 4, 2025

"Intended" is a strong word but it may be desirable per #371

@MartinHinz
Copy link
Collaborator Author

Since this will serve as a placeholder, I see two possible approaches for the current issue:

  1. Populate the placeholder when the form is opened for editing, ensuring that it gets stored in the database upon the next save.
  2. Run a database update to assign the placeholder value to all entries with missing names.

Which option do you prefer, or do you have an alternative suggestion?

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

No branches or pull requests

2 participants