Module: Hyrax::EnsureWellFormedAdminSetService
- Defined in:
- app/services/hyrax/ensure_well_formed_admin_set_service.rb
Overview
Note:
For historical reasons, we lazily apply the default admin set to curation concerns that don’t already have an admin set.
This “service” ensures that we have a well formed AdminSet.
Class Method Summary collapse
-
.call(admin_set_id: nil) ⇒ #to_s
An admin_set_id; if you provide a “present” admin_set_id, this service will return that.
Class Method Details
.call(admin_set_id: nil) ⇒ #to_s
Returns an admin_set_id; if you provide a “present” admin_set_id, this service will return that.
21 22 23 24 25 |
# File 'app/services/hyrax/ensure_well_formed_admin_set_service.rb', line 21 def self.call(admin_set_id: nil) admin_set_id = admin_set_id.presence&.to_s || Hyrax::AdminSetCreateService.find_or_create_default_admin_set.id.to_s Hyrax::PermissionTemplate.find_or_create_by!(source_id: admin_set_id) admin_set_id end |