Sha256: 9c49885333161769dbaf4a2ea288df30124df6cc04398ad9b6e2ab55d44bef38
Contents?: true
Size: 590 Bytes
Versions: 15
Compression:
Stored size: 590 Bytes
Contents
module FactoryBot 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
15 entries across 15 versions & 1 rubygems