From 9534d0b4a8bb017278ef171ef35cbdcd3245e9c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Mon, 14 May 2012 10:37:11 +0200 Subject: Door: to_json calls hibernate!, json_create calls resume! --- lib/evendoors/door.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/evendoors/door.rb b/lib/evendoors/door.rb index 5250ffe..bcf8534 100644 --- a/lib/evendoors/door.rb +++ b/lib/evendoors/door.rb @@ -32,12 +32,14 @@ module EvenDoors { 'kls' => self.class.name, 'name' => @name - }.to_json *a + }.merge(hibernate!).to_json *a end # def self.json_create o raise EvenDoors::Exception.new "JSON #{o['kls']} != #{self.name}" if o['kls'] != self.name - self.new o['name'], o['parent'] + door = self.new o['name'], o['parent'] + door.resume! o + door end # def require_p p_kls -- cgit v1.1-2-g2b99