Module: Hyrax::ProxyDeposit

Extended by:
ActiveSupport::Concern
Included in:
WorkBehavior
Defined in:
app/models/concerns/hyrax/proxy_deposit.rb

Instance Method Summary collapse

Instance Method Details

#request_transfer_to(target) ⇒ Object

Raises:

  • (ArgumentError)

16
17
18
19
20
# File 'app/models/concerns/hyrax/proxy_deposit.rb', line 16

def request_transfer_to(target)
  raise ArgumentError, "Must provide a target" unless target
  deposit_user = ::User.find_by_user_key(depositor)
  ProxyDepositRequest.create!(work_id: id, receiving_user: target, sending_user: deposit_user)
end