Sha256: 7cd8c1448ac78a704f3f735817683b60ea6ef3df020da51b220a60cf48393382

Contents?: true

Size: 729 Bytes

Versions: 15

Compression:

Stored size: 729 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

    trait :male do
      sex { Meibo::Demographic::SEX[:male] }
    end

    trait :female do
      sex { Meibo::Demographic::SEX[:female] }
    end

    trait :unspecified do
      sex { Meibo::Demographic::SEX[:unspecified] }
    end

    trait :other do
      sex { Meibo::Demographic::SEX[:other] }
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
meibo-0.27.1 lib/meibo/factory_bot/demographic.rb
meibo-0.27.0 lib/meibo/factory_bot/demographic.rb
meibo-0.26.0 lib/meibo/factory_bot/demographic.rb
meibo-0.25.3 lib/meibo/factory_bot/demographic.rb
meibo-0.25.2 lib/meibo/factory_bot/demographic.rb
meibo-0.25.1 lib/meibo/factory_bot/demographic.rb
meibo-0.25.0 lib/meibo/factory_bot/demographic.rb
meibo-0.24.0 lib/meibo/factory_bot/demographic.rb
meibo-0.23.0 lib/meibo/factory_bot/demographic.rb
meibo-0.22.0 lib/meibo/factory_bot/demographic.rb
meibo-0.21.0 lib/meibo/factory_bot/demographic.rb
meibo-0.20.0 lib/meibo/factory_bot/demographic.rb
meibo-0.19.0 lib/meibo/factory_bot/demographic.rb
meibo-0.18.0 lib/meibo/factory_bot/demographic.rb
meibo-0.17.0 lib/meibo/factory_bot/demographic.rb