Skip to content

Publications without doi - #338

Merged
lmrodriguezr merged 6 commits into
mainfrom
publications-without-doi
Sep 8, 2026
Merged

Publications without doi#338
lmrodriguezr merged 6 commits into
mainfrom
publications-without-doi

Conversation

@lmrodriguezr

Copy link
Copy Markdown
Member

DOI-less publications are rare but might be needed for some old references. This is very relevant now that we will need to register paratypes.

Modeling and validations for DOI-less publications. Also, rough initial UI (only for curators) to register DOI-less publications
Hide the bulky publication form by default, and allow for autocomplete when possible
@lmrodriguezr

Copy link
Copy Markdown
Member Author

@vangberg Can you please take a look at this? I'm fairly certain it works well, but I appreciate a second pair of eyes on it. Thanks!

To match the bounded form in the incertae sedis branch
@publication = Publication.by_doi(params['publication']['doi'])
if @publication.new_record?
render('new')
if params['publication']['doi'].blank? && current_user.try(:curator?)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Rails 8 we could have used except_on[1] in a validation to create a specific context skipping the doi validation, but I can't think of a nicer way to do it now, so I think this is fine.

[1] https://api.rubyonrails.org/classes/ActiveModel/Validations/ClassMethods.html#method-i-validate-label-Options

Comment thread app/controllers/publications_controller.rb Outdated

@vangberg vangberg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

Only concern is if we should do something to avoid duplicates now that we don't have the DOI as unique key?

Comment thread app/controllers/publications_controller.rb Outdated
Wraps DOI-less publication creation in a single transaction so author failures revert the entire change
@lmrodriguezr
lmrodriguezr merged commit debb44b into main Sep 8, 2026
4 checks passed
@lmrodriguezr
lmrodriguezr deleted the publications-without-doi branch September 8, 2026 09:42
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.

2 participants