Class: Wpxf::Models::Workspace

Inherits:
Sequel::Model
  • Object
show all
Defined in:
lib/wpxf/models/workspace.rb

Overview

A workspace with isolated loot and credentials.

Instance Method Summary collapse

Instance Method Details

#before_destroyObject



21
22
23
24
25
# File 'lib/wpxf/models/workspace.rb', line 21

def before_destroy
  super
  credentials.each(&:destroy)
  loot_items.each(&:destroy)
end

#validateObject



12
13
14
15
16
17
18
19
# File 'lib/wpxf/models/workspace.rb', line 12

def validate
  super

  validates_presence :name
  validates_type String, :name
  validates_unique :name
  validates_format /^[A-Za-z0-9_]{1,50}$/, :name
end