Files
metasploit-gs/lib/msf/core/model/workspace.rb
T
HD Moore 5957dd5393 Add tasks
git-svn-id: file:///home/svn/framework3/trunk@8791 4d416f70-5f16-0410-b530-b9f4589650da
2010-03-11 18:42:21 +00:00

38 lines
697 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 :loots, :dependent => :destroy
has_many :events,:dependent => :destroy
has_many :reports, :dependent => :destroy
has_many :tasks, :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