Class: Hyrax::Transactions::Steps::SetUploadedDate
- Inherits:
-
Object
- Object
- Hyrax::Transactions::Steps::SetUploadedDate
- Includes:
- Dry::Transaction::Operation
- Defined in:
- lib/hyrax/transactions/steps/set_uploaded_date.rb
Overview
A ‘dry-transaction` step that sets the uploaded date to now for an input work.
Instance Method Summary collapse
Instance Method Details
#call(work) ⇒ Dry::Monads::Result
Note:
the current implementation sets the uploaded date to ‘#date_modified` if it exists, falling back on the current datetime.
20 21 22 23 24 |
# File 'lib/hyrax/transactions/steps/set_uploaded_date.rb', line 20 def call(work) work.date_uploaded = work.date_modified || Hyrax::TimeService.time_in_utc Success(work) end |