02eb7ab80d
git-svn-id: file:///home/svn/framework3/trunk@8028 4d416f70-5f16-0410-b530-b9f4589650da
31 lines
528 B
Ruby
31 lines
528 B
Ruby
module Msf
|
|
class DBManager
|
|
|
|
class Workspace < ActiveRecord::Base
|
|
include DBSave
|
|
|
|
DEFAULT = "default"
|
|
|
|
has_many :hosts, :dependent => :destroy
|
|
has_many :notes, :dependent => :destroy
|
|
|
|
has_many :services, :through => :hosts
|
|
has_many :clients, :through => :hosts
|
|
has_many :vulns, :through => :hosts
|
|
#has_many :notes, :through => :hosts
|
|
|
|
validates_uniqueness_of :name
|
|
validates_presence_of :name
|
|
|
|
def self.default
|
|
Workspace.find_or_create_by_name(DEFAULT)
|
|
end
|
|
|
|
def default?
|
|
name == DEFAULT
|
|
end
|
|
end
|
|
|
|
end
|
|
end
|