lib/hyrax/specs/shared_specs/factories/strategies/valkyrie_resource.rb in hyrax-3.6.0 vs lib/hyrax/specs/shared_specs/factories/strategies/valkyrie_resource.rb in hyrax-4.0.0.beta1
- old
+ new
@@ -1,15 +1,9 @@
# frozen_string_literal: true
# @see https://github.com/thoughtbot/factory_bot/blob/master/GETTING_STARTED.md#custom-strategies
# @example
# let(:resource) { FactoryBot.valkyrie_create(:hyrax_work) }
class ValkyrieCreateStrategy
- def initialize
- @strategy = FactoryBot.strategy_by_name(:create).new
- end
-
- delegate :association, to: :@strategy
-
def result(evaluation)
evaluation.notify(:after_build, evaluation.object)
evaluation.notify(:before_create, evaluation.object)
result = persister.save(resource: evaluation.object)