Sha256: 2cce1cb24cdfafee999cdb13e6279d26aa0533fd239c2654d519eed41a454991

Contents?: true

Size: 591 Bytes

Versions: 53

Compression:

Stored size: 591 Bytes

Contents

module FactoryGirl
  class Attribute
    # @api private
    class Association < Attribute
      attr_reader :factory

      def initialize(name, factory, overrides)
        super(name, false)
        @factory   = factory
        @overrides = overrides
      end

      def to_proc
        factory   = @factory
        overrides = @overrides
        traits_and_overrides = [factory, overrides].flatten
        factory_name = traits_and_overrides.shift

        -> { association(factory_name, *traits_and_overrides) }
      end

      def association?
        true
      end
    end
  end
end

Version data entries

53 entries across 41 versions & 11 rubygems

Version Path
challah-1.0.0 vendor/bundle/gems/factory_girl-4.2.0/lib/factory_girl/attribute/association.rb
challah-1.0.0.beta3 vendor/bundle/gems/factory_girl-4.2.0/lib/factory_girl/attribute/association.rb
challah-1.0.0.beta2 vendor/bundle/gems/factory_girl-4.2.0/lib/factory_girl/attribute/association.rb
challah-1.0.0.beta vendor/bundle/gems/factory_girl-4.2.0/lib/factory_girl/attribute/association.rb
challah-1.0.0.beta vendor/bundle/gems/factory_girl-4.1.0/lib/factory_girl/attribute/association.rb
challah-0.9.1.beta.3 vendor/bundle/gems/factory_girl-4.1.0/lib/factory_girl/attribute/association.rb
factory_girl-4.2.0 lib/factory_girl/attribute/association.rb
challah-0.9.1.beta vendor/bundle/gems/factory_girl-4.1.0/lib/factory_girl/attribute/association.rb
sunrise-cms-0.5.0.rc1 vendor/bundle/ruby/1.9.1/gems/factory_girl-4.1.0/lib/factory_girl/attribute/association.rb
challah-0.9.0 vendor/bundle/gems/factory_girl-4.1.0/lib/factory_girl/attribute/association.rb
challah-rolls-0.2.0 vendor/bundle/gems/factory_girl-4.0.0/lib/factory_girl/attribute/association.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.3/vendor/bundle/gems/factory_girl-4.1.0/lib/factory_girl/attribute/association.rb
challah-rolls-0.2.0 vendor/bundle/gems/factory_girl-3.6.1/lib/factory_girl/attribute/association.rb
challah-rolls-0.2.0 vendor/bundle/gems/factory_girl-4.1.0/lib/factory_girl/attribute/association.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/attribute/association.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.3/vendor/bundle/gems/factory_girl-4.0.0/lib/factory_girl/attribute/association.rb
challah-0.8.3 vendor/bundle/gems/factory_girl-4.0.0/lib/factory_girl/attribute/association.rb
challah-0.8.3 vendor/bundle/gems/factory_girl-4.1.0/lib/factory_girl/attribute/association.rb
factory_girl-3.6.2 lib/factory_girl/attribute/association.rb
challah-0.8.1 vendor/bundle/gems/factory_girl-4.0.0/lib/factory_girl/attribute/association.rb