-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds preservation_event for fileset creation and saves the event on f…
…ileset in fedora (#680)
- Loading branch information
Showing
3 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# frozen_string_literal: true | ||
|
||
# This module will be used to define preservation_event | ||
# methods for work and fileset | ||
module PreservationEvents | ||
# @param object - work or file_set object | ||
# @param event_type - preservation_event type | ||
# @param event_start - start time for event | ||
# @param event_details - details of the preservation_event | ||
# @param software_version - software_version used if any | ||
def create_preservation_event(object, event_type, event_start, event_details = nil, software_version = nil) | ||
object.preservation_event_attributes = [{ event_details: event_details, | ||
event_end: DateTime.current, | ||
event_start: event_start, | ||
event_type: event_type, | ||
outcome: 'Success', | ||
software_version: software_version }] | ||
object.save! | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters