Sha256: bfc99d14c7d0829ff520cddf3be7ad02093130113d2f6c73f202c0cf887263b4

Contents?: true

Size: 417 Bytes

Versions: 1

Compression:

Stored size: 417 Bytes

Contents

# frozen_string_literal: true

require 'factory_bot'
require 'securerandom'

FactoryBot.define do
  factory :meibo_demographic, class: 'Meibo::Demographic' do
    initialize_with { new(**attributes) }

    transient do
      user { nil }
    end

    sourced_id { user&.sourced_id || SecureRandom.uuid }

    trait :jp do
      initialize_with { Meibo::JapanProfile::Demographic.new(**attributes) }
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
meibo-0.9.0 lib/meibo/factory_bot/demographic.rb