Sha256: 617d2917a00db2eb96e7263091e8856623ee51dbbed9c5f9ca6b5ddb134f2dba

Contents?: true

Size: 941 Bytes

Versions: 17

Compression:

Stored size: 941 Bytes

Contents

module FactoryGirl
  # @api private
  class Configuration
    attr_reader :factories, :sequences, :traits, :strategies, :callback_names

    attr_accessor :duplicate_attribute_assignment_from_initialize_with

    def initialize
      @factories      = Decorator::DisallowsDuplicatesRegistry.new(Registry.new('Factory'))
      @sequences      = Decorator::DisallowsDuplicatesRegistry.new(Registry.new('Sequence'))
      @traits         = Decorator::DisallowsDuplicatesRegistry.new(Registry.new('Trait'))
      @strategies     = Registry.new('Strategy')
      @callback_names = Set.new
      @definition     = Definition.new

      @duplicate_attribute_assignment_from_initialize_with = true

      to_create {|instance| instance.save! }
      initialize_with { new }
    end

    delegate :to_create, :skip_create, :constructor, to: :@definition

    def initialize_with(&block)
      @definition.define_constructor(&block)
    end
  end
end

Version data entries

17 entries across 15 versions & 3 rubygems

Version Path
challah-rolls-0.2.0 vendor/bundle/gems/factory_girl-3.6.1/lib/factory_girl/configuration.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.0.pre/vendor/bundle/gems/factory_girl-3.6.1/lib/factory_girl/configuration.rb
factory_girl-3.6.2 lib/factory_girl/configuration.rb
challah-rolls-0.1.0 vendor/bundle/gems/factory_girl-3.6.1/lib/factory_girl/configuration.rb
challah-rolls-0.1.0 vendor/bundle/gems/challah-0.8.0.pre/vendor/bundle/gems/factory_girl-3.6.1/lib/factory_girl/configuration.rb
challah-0.8.0.pre vendor/bundle/gems/factory_girl-3.6.1/lib/factory_girl/configuration.rb
challah-0.7.1 vendor/bundle/gems/factory_girl-3.6.1/lib/factory_girl/configuration.rb
challah-0.7.0 vendor/bundle/gems/factory_girl-3.6.1/lib/factory_girl/configuration.rb
challah-0.7.0.pre2 vendor/bundle/gems/factory_girl-3.6.1/lib/factory_girl/configuration.rb
challah-0.7.0.pre vendor/bundle/gems/factory_girl-3.6.1/lib/factory_girl/configuration.rb
factory_girl-3.6.1 lib/factory_girl/configuration.rb
factory_girl-3.6.0 lib/factory_girl/configuration.rb
challah-0.6.2 vendor/bundle/gems/factory_girl-3.5.0/lib/factory_girl/configuration.rb
factory_girl-3.5.0 lib/factory_girl/configuration.rb
factory_girl-3.4.2 lib/factory_girl/configuration.rb
factory_girl-3.4.1 lib/factory_girl/configuration.rb
factory_girl-3.4.0 lib/factory_girl/configuration.rb