Class: Wpxf::Models::Workspace
- Inherits:
-
Sequel::Model
- Object
- Sequel::Model
- Wpxf::Models::Workspace
- Defined in:
- lib/wpxf/models/workspace.rb
Overview
A workspace with isolated loot and credentials.
Instance Method Summary collapse
Instance Method Details
#before_destroy ⇒ Object
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 |
#validate ⇒ Object
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 |