module ZombieBattleground::Api::ValidationHelper

Validation helpers for sanitizing inputs and ouputs

Private Instance Methods

ability_is_a_string() click to toggle source

Appends an error to the model if ability is not a String

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 809
def ability_is_a_string
  value_is_a_string(target: :ability, value: ability)
end
ability_is_a_string_and_not_null() click to toggle source

Appends an error to the model if ability is not a String or nil

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 819
def ability_is_a_string_and_not_null
  value_is_a_string(target: :ability, value: ability, nullable: false)
end
amount_is_a_non_negative_integer() click to toggle source

Appends an error to the model if amount is a negative Integer

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 349
def amount_is_a_non_negative_integer
  value_is_a_non_negative_integer(target: :amount, value: amount)
end
amount_is_a_non_negative_integer_and_not_null() click to toggle source

Appends an error to the model if amount is a negative Integer or nil

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 359
def amount_is_a_non_negative_integer_and_not_null
  value_is_a_non_negative_integer(target: :amount, value: amount, nullable: false)
end
block_height_is_a_non_negative_integer() click to toggle source

Appends an error to the model if block_height is a negative Integer

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 429
def block_height_is_a_non_negative_integer
  value_is_a_non_negative_integer(target: :block_height, value: block_height)
end
block_height_is_a_non_negative_integer_and_not_null() click to toggle source

Appends an error to the model if block_height is a negative Integer or nil

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 439
def block_height_is_a_non_negative_integer_and_not_null
  value_is_a_non_negative_integer(target: :block_height, value: block_height, nullable: false)
end
card_name_is_a_string() click to toggle source

Appends an error to the model if card_name is not a String

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 329
def card_name_is_a_string
  value_is_a_string(target: :card_name, value: card_name)
end
card_name_is_a_string_and_not_null() click to toggle source

Appends an error to the model if card_name is not a String or nil

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 339
def card_name_is_a_string_and_not_null
  value_is_a_string(target: :card_name, value: card_name, nullable: false)
end
cost_is_a_non_negative_integer() click to toggle source

Appends an error to the model if cost is a negative Integer

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 789
def cost_is_a_non_negative_integer
  value_is_a_non_negative_integer(target: :cost, value: cost)
end
cost_is_a_non_negative_integer_and_not_null() click to toggle source

Appends an error to the model if cost is a negative Integer or nil

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 799
def cost_is_a_non_negative_integer_and_not_null
  value_is_a_non_negative_integer(target: :cost, value: cost, nullable: false)
end
created_at_is_a_time() click to toggle source

Appends an error to the model if created_at is not a Time

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 389
def created_at_is_a_time
  value_is_a_time(target: :created_at, value: created_at)
end
created_at_is_a_time_and_not_null() click to toggle source

Appends an error to the model if created_at is not a Time or nil

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 399
def created_at_is_a_time_and_not_null
  value_is_a_time(target: :created_at, value: created_at, nullable: false)
end
damage_is_a_non_negative_integer() click to toggle source

Appends an error to the model if damage is a negative Integer

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 749
def damage_is_a_non_negative_integer
  value_is_a_non_negative_integer(target: :damage, value: damage)
end
damage_is_a_non_negative_integer_and_not_null() click to toggle source

Appends an error to the model if damage is a negative Integer or nil

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 759
def damage_is_a_non_negative_integer_and_not_null
  value_is_a_non_negative_integer(target: :damage, value: damage, nullable: false)
end
deck_id_is_a_non_negative_integer() click to toggle source

Appends an error to the model if deck_id is a negative Integer

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 149
def deck_id_is_a_non_negative_integer
  value_is_a_non_negative_integer(target: :deck_id, value: deck_id)
end
deck_id_is_a_non_negative_integer_and_not_null() click to toggle source

Appends an error to the model if deck_id is a negative Integer or nil

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 159
def deck_id_is_a_non_negative_integer_and_not_null
  value_is_a_non_negative_integer(target: :deck_id, value: deck_id, nullable: false)
end
description_is_a_string() click to toggle source

Appends an error to the model if description is not a String

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 649
def description_is_a_string
  value_is_a_string(target: :description, value: description)
end
description_is_a_string_and_not_null() click to toggle source

Appends an error to the model if description is not a String or nil

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 659
def description_is_a_string_and_not_null
  value_is_a_string(target: :description, value: description, nullable: false)
end
frame_is_a_string() click to toggle source

Appends an error to the model if frame is not a String

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 729
def frame_is_a_string
  value_is_a_string(target: :frame, value: frame)
end
frame_is_a_string_and_not_null() click to toggle source

Appends an error to the model if frame is not a String or nil

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 739
def frame_is_a_string_and_not_null
  value_is_a_string(target: :frame, value: frame, nullable: false)
end
health_is_a_non_negative_integer() click to toggle source

Appends an error to the model if health is a negative Integer

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 769
def health_is_a_non_negative_integer
  value_is_a_non_negative_integer(target: :health, value: health)
end
health_is_a_non_negative_integer_and_not_null() click to toggle source

Appends an error to the model if health is a negative Integer or nil

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 779
def health_is_a_non_negative_integer_and_not_null
  value_is_a_non_negative_integer(target: :health, value: health, nullable: false)
end
hero_id_is_a_non_negative_integer() click to toggle source

Appends an error to the model if hero_id is a negative Integer

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 189
def hero_id_is_a_non_negative_integer
  value_is_a_non_negative_integer(target: :hero_id, value: hero_id)
end
hero_id_is_a_non_negative_integer_and_not_null() click to toggle source

Appends an error to the model if hero_id is a negative Integer or nil

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 199
def hero_id_is_a_non_negative_integer_and_not_null
  value_is_a_non_negative_integer(target: :hero_id, value: hero_id, nullable: false)
end
id_is_a_non_negative_integer() click to toggle source

Appends an error to the model if id is a negative Integer

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 109
def id_is_a_non_negative_integer
  value_is_a_non_negative_integer(target: :id, value: id)
end
id_is_a_non_negative_integer_and_not_null() click to toggle source

Appends an error to the model if id is a negative Integer or nil

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 119
def id_is_a_non_negative_integer_and_not_null
  value_is_a_non_negative_integer(target: :id, value: id, nullable: false)
end
image_url_is_a_string() click to toggle source

Appends an error to the model if image_url is not a String

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 829
def image_url_is_a_string
  value_is_a_string(target: :image_url, value: image_url)
end
image_url_is_a_string_and_not_null() click to toggle source

Appends an error to the model if image_url is not a String or nil

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 839
def image_url_is_a_string_and_not_null
  value_is_a_string(target: :image_url, value: image_url, nullable: false)
end
kind_is_a_string() click to toggle source

Appends an error to the model if kind is not a String

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 609
def kind_is_a_string
  value_is_a_string(target: :kind, value: kind)
end
kind_is_a_string_and_not_null() click to toggle source

Appends an error to the model if kind is not a String or nil

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 619
def kind_is_a_string_and_not_null
  value_is_a_string(target: :kind, value: kind, nullable: false)
end
limit_is_a_non_negative_integer() click to toggle source

Appends an error to the model if limit is a negative Integer

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 309
def limit_is_a_non_negative_integer
  value_is_a_non_negative_integer(target: :limit, value: limit)
end
limit_is_a_non_negative_integer_and_not_null() click to toggle source

Appends an error to the model if limit is a negative Integer or nil

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 319
def limit_is_a_non_negative_integer_and_not_null
  value_is_a_non_negative_integer(target: :limit, value: limit, nullable: false)
end
mould_id_is_a_string() click to toggle source

Appends an error to the model if mould_id is not a String

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 589
def mould_id_is_a_string
  value_is_a_string(target: :mould_id, value: mould_id)
end
mould_id_is_a_string_and_not_null() click to toggle source

Appends an error to the model if mould_id is not a String or nil

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 599
def mould_id_is_a_string_and_not_null
  value_is_a_string(target: :mould_id, value: mould_id, nullable: false)
end
name_is_a_string() click to toggle source

Appends an error to the model if name is not a String

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 169
def name_is_a_string
  value_is_a_string(target: :name, value: name)
end
name_is_a_string_and_not_null() click to toggle source

Appends an error to the model if name is not a String or nil

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 179
def name_is_a_string_and_not_null
  value_is_a_string(target: :name, value: name, nullable: false)
end
page_is_a_non_negative_integer() click to toggle source

Appends an error to the model if page is a negative Integer

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 289
def page_is_a_non_negative_integer
  value_is_a_non_negative_integer(target: :page, value: page)
end
page_is_a_non_negative_integer_and_not_null() click to toggle source

Appends an error to the model if page is a negative Integer or nil

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 299
def page_is_a_non_negative_integer_and_not_null
  value_is_a_non_negative_integer(target: :page, value: page, nullable: false)
end
player1_deck_id_is_a_non_negative_integer() click to toggle source

Appends an error to the model if player1_deck_id is a negative Integer

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 489
def player1_deck_id_is_a_non_negative_integer
  value_is_a_non_negative_integer(target: :player1_deck_id, value: player1_deck_id)
end
player1_deck_id_is_a_non_negative_integer_and_not_null() click to toggle source

Appends an error to the model if player1_deck_id is a negative Integer or nil

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 499
def player1_deck_id_is_a_non_negative_integer_and_not_null
  value_is_a_non_negative_integer(target: :player1_deck_id, value: player1_deck_id, nullable: false)
end
player1_id_is_a_string() click to toggle source

Appends an error to the model if player1_id is not a String

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 449
def player1_id_is_a_string
  value_is_a_string(target: :player1_id, value: player1_id)
end
player1_id_is_a_string_and_not_null() click to toggle source

Appends an error to the model if player1_id is not a String or nil

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 459
def player1_id_is_a_string_and_not_null
  value_is_a_string(target: :player1_id, value: player1_id, nullable: false)
end
player2_deck_id_is_a_non_negative_integer() click to toggle source

Appends an error to the model if player2_deck_id is a negative Integer

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 509
def player2_deck_id_is_a_non_negative_integer
  value_is_a_non_negative_integer(target: :player2_deck_id, value: player2_deck_id)
end
player2_deck_id_is_a_non_negative_integer_and_not_null() click to toggle source

Appends an error to the model if player2_deck_id is a negative Integer or nil

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 519
def player2_deck_id_is_a_non_negative_integer_and_not_null
  value_is_a_non_negative_integer(target: :player2_deck_id, value: player2_deck_id, nullable: false)
end
player2_id_is_a_string() click to toggle source

Appends an error to the model if player2_id is not a String

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 469
def player2_id_is_a_string
  value_is_a_string(target: :player2_id, value: player2_id)
end
player2_id_is_a_string_and_not_null() click to toggle source

Appends an error to the model if player2_id is not a String or nil

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 479
def player2_id_is_a_string_and_not_null
  value_is_a_string(target: :player2_id, value: player2_id, nullable: false)
end
primary_skill_id_is_a_non_negative_integer() click to toggle source

Appends an error to the model if primary_skill_id is a negative Integer

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 209
def primary_skill_id_is_a_non_negative_integer
  value_is_a_non_negative_integer(target: :primary_skill_id, value: primary_skill_id)
end
primary_skill_id_is_a_non_negative_integer_and_not_null() click to toggle source

Appends an error to the model if primary_skill_id is a negative Integer or nil

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 219
def primary_skill_id_is_a_non_negative_integer_and_not_null
  value_is_a_non_negative_integer(target: :primary_skill_id, value: primary_skill_id, nullable: false)
end
random_seed_is_a_non_negative_integer() click to toggle source

Appends an error to the model if random_seed is a negative Integer

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 529
def random_seed_is_a_non_negative_integer
  value_is_a_non_negative_integer(target: :random_seed, value: random_seed)
end
random_seed_is_a_non_negative_integer_and_not_null() click to toggle source

Appends an error to the model if random_seed is a negative Integer or nil

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 539
def random_seed_is_a_non_negative_integer_and_not_null
  value_is_a_non_negative_integer(target: :random_seed, value: random_seed, nullable: false)
end
rank_is_a_string() click to toggle source

Appends an error to the model if rank is not a String

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 669
def rank_is_a_string
  value_is_a_string(target: :rank, value: rank)
end
rank_is_a_string_and_not_null() click to toggle source

Appends an error to the model if rank is not a String or nil

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 679
def rank_is_a_string_and_not_null
  value_is_a_string(target: :rank, value: rank, nullable: false)
end
rarity_is_a_string() click to toggle source

Appends an error to the model if rarity is not a String

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 709
def rarity_is_a_string
  value_is_a_string(target: :rarity, value: rarity)
end
rarity_is_a_string_and_not_null() click to toggle source

Appends an error to the model if rarity is not a String or nil

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 719
def rarity_is_a_string_and_not_null
  value_is_a_string(target: :rarity, value: rarity, nullable: false)
end
secondary_skill_id_is_a_non_negative_integer() click to toggle source

Appends an error to the model if secondary_skill_id is a negative Integer

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 229
def secondary_skill_id_is_a_non_negative_integer
  value_is_a_non_negative_integer(target: :secondary_skill_id, value: secondary_skill_id)
end
secondary_skill_id_is_a_non_negative_integer_and_not_null() click to toggle source

Appends an error to the model if secondary_skill_id is a negative Integer or nil

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 239
def secondary_skill_id_is_a_non_negative_integer_and_not_null
  value_is_a_non_negative_integer(target: :secondary_skill_id, value: secondary_skill_id, nullable: false)
end
sender_address_is_a_string() click to toggle source

Appends an error to the model if sender_address is not a String

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 369
def sender_address_is_a_string
  value_is_a_string(target: :sender_address, value: sender_address)
end
sender_address_is_a_string_and_not_null() click to toggle source

Appends an error to the model if sender_address is not a String or nil

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 379
def sender_address_is_a_string_and_not_null
  value_is_a_string(target: :sender_address, value: sender_address, nullable: false)
end
set_is_a_string() click to toggle source

Appends an error to the model if set is not a String

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 629
def set_is_a_string
  value_is_a_string(target: :set, value: set)
end
set_is_a_string_and_not_null() click to toggle source

Appends an error to the model if set is not a String or nil

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 639
def set_is_a_string_and_not_null
  value_is_a_string(target: :set, value: set, nullable: false)
end
status_is_a_string() click to toggle source

Appends an error to the model if status is not a String

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 549
def status_is_a_string
  value_is_a_string(target: :status, value: status)
end
status_is_a_string_and_not_null() click to toggle source

Appends an error to the model if status is not a String or nil

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 559
def status_is_a_string_and_not_null
  value_is_a_string(target: :status, value: status, nullable: false)
end
total_is_a_non_negative_integer() click to toggle source

Appends an error to the model if total is a negative Integer

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 269
def total_is_a_non_negative_integer
  value_is_a_non_negative_integer(target: :total, value: total)
end
total_is_a_non_negative_integer_and_not_null() click to toggle source

Appends an error to the model if total is a negative Integer or nil

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 279
def total_is_a_non_negative_integer_and_not_null
  value_is_a_non_negative_integer(target: :total, value: total, nullable: false)
end
type_is_a_string() click to toggle source

Appends an error to the model if type is not a String

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 689
def type_is_a_string
  value_is_a_string(target: :type, value: type)
end
type_is_a_string_and_not_null() click to toggle source

Appends an error to the model if type is not a String or nil

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 699
def type_is_a_string_and_not_null
  value_is_a_string(target: :type, value: type, nullable: false)
end
updated_at_is_a_time() click to toggle source

Appends an error to the model if updated_at is not a Time

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 409
def updated_at_is_a_time
  value_is_a_time(target: :updated_at, value: updated_at)
end
updated_at_is_a_time_and_not_null() click to toggle source

Appends an error to the model if updated_at is not a Time or nil

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 419
def updated_at_is_a_time_and_not_null
  value_is_a_time(target: :updated_at, value: updated_at, nullable: false)
end
user_id_is_a_string() click to toggle source

Appends an error to the model if user_id is not a String

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 129
def user_id_is_a_string
  value_is_a_string(target: :user_id, value: user_id)
end
user_id_is_a_string_and_not_null() click to toggle source

Appends an error to the model if user_id is not a String or nil

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 139
def user_id_is_a_string_and_not_null
  value_is_a_string(target: :user_id, value: user_id, nullable: false)
end
value_is_a_class(target:, value:, nullable:, klass:) click to toggle source

Appends an error to the model if the value is not the expected class

@param target [Symbol] @param value [Object] @param nullable [Boolean] @param klass [Class]

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 21
def value_is_a_class(target:, value:, nullable:, klass:)
  return if (nullable && value.nil?) || value.is_a?(klass)

  errors.add(target, "#{target} must be a #{klass}")
end
value_is_a_non_negative_integer(target:, value:, nullable: true) click to toggle source

Appends an error to the model if the value is a negative Integer

@param target [Symbol] @param value [Object] @param nullable [Boolean]

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 94
def value_is_a_non_negative_integer(target:, value:, nullable: true)
  value_is_an_integer(target: target, value: value, nullable: nullable)
  return unless errors.messages.empty?
  return if nullable && value.nil?
  return if value.zero? || value.positive?

  errors.add(target, "#{target} must be not negative")
end
value_is_a_string(target:, value:, nullable: true) click to toggle source

Appends an error to the model if the value is not String

@param target [Symbol] @param value [Object] @param nullable [Boolean]

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 37
def value_is_a_string(target:, value:, nullable: true)
  value_is_a_class(
    target: target,
    value: value,
    nullable: nullable,
    klass: String
  )
end
value_is_a_time(target:, value:, nullable: true) click to toggle source

Appends an error to the model if the value is not Time

@param target [Symbol] @param value [Object] @param nullable [Boolean]

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 56
def value_is_a_time(target:, value:, nullable: true)
  value_is_a_class(
    target: target,
    value: value,
    nullable: nullable,
    klass: Time
  )
end
value_is_an_integer(target:, value:, nullable: true) click to toggle source

Appends an error to the model if the value is not Integer

@param target [Symbol] @param value [Object] @param nullable [Boolean]

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 75
def value_is_an_integer(target:, value:, nullable: true)
  value_is_a_class(
    target: target,
    value: value,
    nullable: nullable,
    klass: Integer
  )
end
version_is_a_string() click to toggle source

Appends an error to the model if version is not a String

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 249
def version_is_a_string
  value_is_a_string(target: :version, value: version)
end
version_is_a_string_and_not_null() click to toggle source

Appends an error to the model if version is not a String or nil

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 259
def version_is_a_string_and_not_null
  value_is_a_string(target: :version, value: version, nullable: false)
end
winner_id_is_a_string() click to toggle source

Appends an error to the model if winner_id is not a String

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 569
def winner_id_is_a_string
  value_is_a_string(target: :winner_id, value: winner_id)
end
winner_id_is_a_string_and_not_null() click to toggle source

Appends an error to the model if winner_id is not a String or nil

@return [void]

@api private

# File lib/zombie_battleground/api/validation_helper.rb, line 579
def winner_id_is_a_string_and_not_null
  value_is_a_string(target: :winner_id, value: winner_id, nullable: false)
end