Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
RDMS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
researchdata
RDMS
Commits
8b21702d
Commit
8b21702d
authored
2 years ago
by
Anusha Ranganathan
Browse files
Options
Downloads
Patches
Plain Diff
Also modify rake task to read collection title from config file
parent
cae35691
No related branches found
Branches containing commit
No related tags found
Tags containing commit
3 merge requests
!115
Tombstone not available for dataset
,
!77
Bump ruby v2.7.7
,
!26
Feature/s3 storage
Pipeline
#4706
failed
2 years ago
Stage: build
Stage: test
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
hyrax/lib/tasks/create_crc_1280_collection.rake
+4
-3
4 additions, 3 deletions
hyrax/lib/tasks/create_crc_1280_collection.rake
with
4 additions
and
3 deletions
hyrax/lib/tasks/create_crc_1280_collection.rake
+
4
−
3
View file @
8b21702d
...
...
@@ -3,13 +3,14 @@ namespace :rdms do
namespace
:crc_1280_collection
do
desc
"Create CRC 1280 Collection Types and CRC 1280 Collection"
task
create: :environment
do
collection_type
=
Hyrax
::
CollectionType
.
find_or_create_by
(
title:
'CRC 1280'
)
crc_collection_title
=
ENV
.
fetch
(
'CRC_1280_COLLECTION'
,
"CRC 1280"
)
collection_type
=
Hyrax
::
CollectionType
.
find_or_create_by
(
title:
crc_collection_title
)
collection_type_gid
=
"gid://hyrax3-app/Hyrax::CollectionType/
#{
collection_type
.
id
}
"
crc_1280_collections
=
collection_type
.
collections
.
select
{
|
t
|
t
.
title
==
[
"CRC 1280"
]
}
crc_1280_collections
=
collection_type
.
collections
.
select
{
|
t
|
t
.
title
==
[
crc_collection_title
]
}
unless
crc_1280_collections
.
any?
collection
=
Hyrax
.
config
.
collection_class
.
create
(
title:
[
'CRC 1280'
],
source
:[
SecureRandom
.
uuid
],
collection_type_gid:
collection_type_gid
)
collection
=
Hyrax
.
config
.
collection_class
.
create
(
title:
[
crc_collection_title
],
source
:[
SecureRandom
.
uuid
],
collection_type_gid:
collection_type_gid
)
admin_user
=
User
.
find_by
(
email:
'admin@hyrax'
)
collection
.
apply_depositor_metadata
(
admin_user
.
user_key
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment