Class: Hyrax::Transactions::Steps::ChangeDepositor
- Inherits:
-
Object
- Object
- Hyrax::Transactions::Steps::ChangeDepositor
- Defined in:
- lib/hyrax/transactions/steps/change_depositor.rb
Overview
Add a given ‘::User` as the `#depositor` Move the previous value of that property to `#proxy_depositor`
If no user is given, simply passes as a ‘Success`.
Defined Under Namespace
Classes: NullUser
Instance Method Summary collapse
Instance Method Details
#call(obj, user: NullUser.new, reset: false) ⇒ Dry::Monads::Result
24 25 26 27 28 29 30 31 32 |
# File 'lib/hyrax/transactions/steps/change_depositor.rb', line 24 def call(obj, user: NullUser.new, reset: false) return Success(obj) unless user&.user_key obj = Hyrax::ChangeDepositorService.call(obj, user, reset) Success(obj) rescue StandardError => err Failure([err., obj]) end |