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
293c13ea
Commit
293c13ea
authored
2 years ago
by
Anusha Ranganathan
Browse files
Options
Downloads
Patches
Plain Diff
Changed validation method and reordered fields
parent
6cba2f80
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!19
Develop
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
hyrax/app/models/dataset.rb
+30
-28
30 additions, 28 deletions
hyrax/app/models/dataset.rb
hyrax/spec/models/dataset_spec.rb
+1
-1
1 addition, 1 deletion
hyrax/spec/models/dataset_spec.rb
with
31 additions
and
29 deletions
hyrax/app/models/dataset.rb
+
30
−
28
View file @
293c13ea
...
...
@@ -7,36 +7,38 @@ class Dataset < ActiveFedora::Base
self
.
indexer
=
DatasetIndexer
# Change this to restrict which works can be added as a child.
# self.valid_child_concerns = []
validates
:title
,
presence:
{
message:
'Your
work
must have a title.'
}
validates
:title
,
presence:
{
message:
'Your
dataset
must have a title.'
}
# property date_modified - defined in core metadata - keep
# property date_uploaded - defined in core metadata - keep
# property depositor - defined in core metadata - keep
# property title - defined in core metadata - keep
# ------ properties from core metadata ------
# property date_modified - not displayed (filled in by the system)
# property date_uploaded - not displayed (filled in by the system)
# property depositor - not displayed (filled in by the system)
# property title - keep
# property alternative_title - defined in the basic metadata - keep
# property label - defined in the basic metadata - keep (used for version label)
# property relative_path - defined in the basic metadata - ignore (used for file storage)
# property import_url - defined in the basic metadata - ignore (used for file imports)
# property resource_type - defined in the basic metadata - keep
# property creator - defined in the basic metadata - ignore
# property contributor - defined in the basic metadata - ignore
# property description - defined in the basic metadata - keep
# property abstract - defined in the basic metadata - keep
# property keyword - defined in the basic metadata - keep
# property license - defined in the basic metadata - keep
# property rights_notes - defined in the basic metadata - keep
# property rights_statement - defined in the basic metadata - keep
# property access_right - defined in the basic metadata - keep
# property publisher - defined in the basic metadata - keep
# property date_created - defined in the basic metadata - keep
# property subject - defined in the basic metadata - keep
# property language - defined in the basic metadata - keep
# property identifier - defined in the basic metadata - ignore
# property based_near - defined in the basic metadata - ignore
# property related_url - defined in the basic metadata - ignore
# property bibliographic_citation - defined in the basic metadata - keep
# property source - defined in the basic metadata - keep
# ------ properties from basic metadata ------
# property alternative_title - keep
# property label - not displayed, used for file version label
# property relative_path - not displayed, used for file storage
# property import_url - not displayed, used for file imports
# property resource_type - keep
# property creator - do not display
# property contributor - do not display
# property description - keep
# property abstract - keep
# property keyword - keep
# property license - keep
# property rights_notes - do not display
# property rights_statement - do not display
# property access_right - do not display
# property publisher - keep
# property date_created - do not display
# property subject - keep
# property language - keep
# property identifier - do not display (used to store alternate identifiers)
# property based_near - do not display
# property related_url - do not display
# property bibliographic_citation - not displayed (generated by the system)
# property source - do not display (should be filled in by the system for bulk imports)
property
:doi
,
predicate:
::
RDF
::
Vocab
::
DataCite
.
doi
,
multiple:
false
do
|
index
|
index
.
as
:symbol
...
...
This diff is collapsed.
Click to expand it.
hyrax/spec/models/dataset_spec.rb
+
1
−
1
View file @
293c13ea
...
...
@@ -33,7 +33,7 @@ RSpec.describe Dataset do
it
'requires title'
do
@obj
=
build
(
:dataset
,
title:
nil
)
expect
{
@obj
.
save!
}.
to
raise_error
(
ActiveFedora
::
RecordInvalid
,
'Validation failed: Title Your
work
must have a title.'
)
'Validation failed: Title Your
dataset
must have a title.'
)
end
it
'has a multi valued title field'
do
...
...
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