Class: Hyrax::Transactions::Steps::SaveCollectionBanner
- Inherits:
-
Object
- Object
- Hyrax::Transactions::Steps::SaveCollectionBanner
- Defined in:
- lib/hyrax/transactions/steps/save_collection_banner.rb
Overview
Adds banner info via ‘ChangeSet`.
During the update collection process this step is called to update the file to be used as a the banner for the collection.
Instance Method Summary collapse
-
#call(collection_resource, update_banner_file_ids: nil, banner_unchanged_indicator: true) ⇒ Dry::Monads::Result
‘Failure` if the banner info fails to save; `Success(input)`, otherwise.
Instance Method Details
#call(collection_resource, update_banner_file_ids: nil, banner_unchanged_indicator: true) ⇒ Dry::Monads::Result
Returns ‘Failure` if the banner info fails to save; `Success(input)`, otherwise.
21 22 23 24 25 26 |
# File 'lib/hyrax/transactions/steps/save_collection_banner.rb', line 21 def call(collection_resource, update_banner_file_ids: nil, banner_unchanged_indicator: true) return Success(collection_resource) if ActiveModel::Type::Boolean.new.cast() collection_id = collection_resource.id.to_s (collection_id: collection_id, update_banner_file_ids: ) Success(collection_resource) end |