diff --git a/app/controllers/stash_engine/admin_datasets_controller.rb b/app/controllers/stash_engine/admin_datasets_controller.rb index 72394807d8..787c67eb85 100644 --- a/app/controllers/stash_engine/admin_datasets_controller.rb +++ b/app/controllers/stash_engine/admin_datasets_controller.rb @@ -59,7 +59,7 @@ def popup ) when 'publication' authorize %i[stash_engine admin_datasets], :data_popup? - @publication = StashEngine::ResourcePublication.find_or_initialize_by(resource_id: @identifier.latest_resource.id) + @publication = StashEngine::ResourcePublication.find_or_create_by(resource_id: @identifier.latest_resource.id) when 'data' authorize %i[stash_engine admin_datasets], :data_popup? setup_internal_data_list