Wednesday, July 15, 2026 2:56:53 AM
> exile_territory.rb
# frozen_string_literal: true

FactoryBot.define do
  factory :exile_territory, class: "ESM::ExileTerritory" do
    server_id {}
    name { "ExileTerritory - #{Faker::FunnyName.name}" }
    position_x { Faker::Number.between(from: 1, to: 1000) }
    position_y { Faker::Number.between(from: 1, to: 1000) }
    position_z { Faker::Number.between(from: 1, to: 20) }
    radius { Faker::Number.between(from: 1, to: 100) }
    level { Faker::Number.between(from: 1, to: 7) }
    flag_texture { ESM::ExileTerritory::FLAG_TEXTURES.sample }
    xm8_protectionmoney_notified { false }
    build_rights { [] }
    moderators { [] }
    last_paid_at { Time.now }

    trait :stolen do
      flag_stolen { true }
      flag_stolen_by_uid { Faker::Steam.uid }
      flag_stolen_at { Time.current }
    end

    before :create do |territory|
      next if ESM::ExileAccount.where(uid: territory.owner_uid).any?

      create(:exile_account, uid: territory.owner_uid)
    end
  end
end
All opinions represented herein are my own
- © 2024 - 2026 itsthedevman
- build 43aa0d7