Sha256: ccaf75997b3c682db78de435bdbd4d3e540881a143d413e8bb90a3b8e5e468c9

Contents?: true

Size: 467 Bytes

Versions: 14

Compression:

Stored size: 467 Bytes

Contents

module FactoryBot
  module Strategy
    class Create
      def association(runner)
        runner.run
      end

      def result(evaluation)
        evaluation.object.tap do |instance|
          evaluation.notify(:after_build, instance)
          evaluation.notify(:before_create, instance)
          evaluation.create(instance)
          evaluation.notify(:after_create, instance)
        end
      end

      def to_sym
        :create
      end
    end
  end
end

Version data entries

14 entries across 13 versions & 3 rubygems

Version Path
factory_bot-6.5.1 lib/factory_bot/strategy/create.rb
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.1.0/gems/factory_bot-6.5.0/lib/factory_bot/strategy/create.rb
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.3.0/gems/factory_bot-6.5.0/lib/factory_bot/strategy/create.rb
factory_bot-6.5.0 lib/factory_bot/strategy/create.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/factory_bot-6.4.6/lib/factory_bot/strategy/create.rb
factory_bot-6.4.6 lib/factory_bot/strategy/create.rb
factory_bot-6.4.5 lib/factory_bot/strategy/create.rb
factory_bot-6.4.4 lib/factory_bot/strategy/create.rb
factory_bot-6.4.3 lib/factory_bot/strategy/create.rb
factory_bot-6.4.2 lib/factory_bot/strategy/create.rb
factory_bot-6.4.1 lib/factory_bot/strategy/create.rb
factory_bot-6.4.0 lib/factory_bot/strategy/create.rb
factory_bot-6.3.0 lib/factory_bot/strategy/create.rb
factory_bot-6.2.1 lib/factory_bot/strategy/create.rb