From: Tomas Doran (t0m) <t0m@state51.co.uk>
Date: Mon, 1 Jun 2009 23:44:46 +0000 (+0100)
Subject: Apply patch from RT#46343
X-Git-Tag: 0.18~3
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8f677182dc509a2559e5c29d0e385038a13dd641;p=gitmo%2FMooseX-Storage.git

Apply patch from RT#46343
---

diff --git a/Changes b/Changes
index 88c69ea..aef0061 100644
--- a/Changes
+++ b/Changes
@@ -1,7 +1,8 @@
 Revision history for MooseX-Storage
 
 0.18
-   * Added support for Maybe[...] constraints
+   * Fix test failures without JSON::Any. Patch from RT#46343 (Nicholas Clarke)
+   * Added support for Maybe[...] constraints fixing RT#43165 (plu)
 
 0.17
    * Change MooseX::Storage::Engine to use get_all_attributes,
diff --git a/lib/MooseX/Storage/Util.pm b/lib/MooseX/Storage/Util.pm
index 6bdd02e..d67f295 100644
--- a/lib/MooseX/Storage/Util.pm
+++ b/lib/MooseX/Storage/Util.pm
@@ -31,9 +31,8 @@ sub peek {
 
 sub _inflate_json {
     my ($class, $json) = @_;
-    
-    require JSON::Any;
-    eval { JSON::Any->import };
+
+    eval { require JSON::Any; JSON::Any->import };
     confess "Could not load JSON module because : $@" if $@; 
     
     utf8::encode($json) if utf8::is_utf8($json);