lib/undo.rb in undo-0.0.1 vs lib/undo.rb in undo-0.0.2
- old
+ new
@@ -1,14 +1,13 @@
-require "undo/version"
+require "undo/gemspec"
require "undo/config"
module Undo
require "undo/model"
def self.configure(&block)
- yield(config) if block_given?
- config
+ block_given? ? block.call(config) : config
end
def self.config
@config ||= Undo::Config.new
end
@@ -16,8 +15,10 @@
def self.wrap(object, *args)
Model.new object, *args
end
def self.restore(uuid, options = {})
- config.with(options).storage.fetch uuid
+ config.with(options) do |config|
+ config.serializer.deserialize config.storage.fetch uuid
+ end
end
end