Class: RuneRb::Database::GameBannedNames

Inherits:
Object
  • Object
show all
Defined in:
app/database/models/game/banned_names.rb

Overview

Name that is banned from usage. Models a row of the `game_banned_names` table.

Since:

  • 0.9.3

Class Method Summary collapse

Class Method Details

.append(entry) ⇒ Object

Adds a new entry to the dataset.

Parameters:

  • entry (String)

    the name to ban.

Since:

  • 0.9.3


10
11
12
13
14
# File 'app/database/models/game/banned_names.rb', line 10

def append(entry)
  insert(name: entry)
rescue Sequel::ConstraintViolation
  raise RuneRb::System::Errors::ConflictingNameError.new(:banned_name, entry)
end