Class: Hyrax::Transactions::ApplyChangeSet
- Inherits:
-
Transaction
- Object
- Transaction
- Hyrax::Transactions::ApplyChangeSet
- Defined in:
- lib/hyrax/transactions/apply_change_set.rb
Overview
Applies and saves a ChangeSet.
This transaction is intended to ensure appropriate results for a Hyrax model when saving changes from a ChangeSet. For example: it will set the system-managed metadata like modified date.
If your application has custom system managed metadata, this is an appropriate place to inject that behavior.
This will also validate the ChangeSet. Which validations to use is delegated on the ChangeSet itself.
Constant Summary collapse
- DEFAULT_STEPS =
['change_set.set_modified_date', 'change_set.set_uploaded_date_unless_present', 'change_set.validate', 'change_set.save'].freeze
Instance Attribute Summary
Attributes inherited from Transaction
Instance Method Summary collapse
-
#initialize(container: Container, steps: DEFAULT_STEPS) ⇒ ApplyChangeSet
constructor
A new instance of ApplyChangeSet.
Methods inherited from Transaction
Constructor Details
#initialize(container: Container, steps: DEFAULT_STEPS) ⇒ ApplyChangeSet
Returns a new instance of ApplyChangeSet.
42 43 44 |
# File 'lib/hyrax/transactions/apply_change_set.rb', line 42 def initialize(container: Container, steps: DEFAULT_STEPS) super end |