Serialize service.info, handle all 3 forms of possible serialized data (marshal, yaml, and string)
git-svn-id: file:///home/svn/framework3/trunk@9679 4d416f70-5f16-0410-b530-b9f4589650daunstable
parent
0d40a69f16
commit
a482f66cb9
|
@ -9,7 +9,7 @@ class ActiveRecord::Base
|
||||||
begin
|
begin
|
||||||
Marshal.load(string.unpack("m")[0])
|
Marshal.load(string.unpack("m")[0])
|
||||||
rescue ::Exception => e
|
rescue ::Exception => e
|
||||||
YAML.load(string)
|
YAML.load(string) rescue string
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -6,7 +6,10 @@ class Service < ActiveRecord::Base
|
||||||
has_many :vulns, :dependent => :destroy
|
has_many :vulns, :dependent => :destroy
|
||||||
has_many :notes, :dependent => :destroy
|
has_many :notes, :dependent => :destroy
|
||||||
belongs_to :host
|
belongs_to :host
|
||||||
|
|
||||||
|
serialize :info
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue