Module: Hyrax::EnsureMigratedBehavior

Extended by:
ActiveSupport::Concern
Included in:
Dashboard::CollectionsController, FileSetsController, WorksControllerBehavior
Defined in:
app/controllers/concerns/hyrax/ensure_migrated_behavior.rb

Overview

A shared module for controllers to ensure that a resource has been fully migrated from a Wings-backed ActiveFedora object to a native Valkyrie resource before an action (like ‘edit`) is performed.

This is a temporary solution to handle just-in-time migrations for legacy objects when ‘Hyrax.config.flexible?` is true.

Examples:

class MyController < ApplicationController
  include Hyrax::EnsureMigratedBehavior

  before_action do
    @resource = find_my_resource
    @resource = ensure_migrated(resource: @resource, form: build_form, transaction_key: 'my.transaction')
  end
end