nested-hstore 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/nested_hstore/serializer.rb +3 -1
- data/lib/nested_hstore/version.rb +1 -1
- metadata +2 -2
@@ -103,7 +103,9 @@ module NestedHstore
|
|
103
103
|
# This isn't ideal: how do we know whether each value in an hstore is JSON or a
|
104
104
|
# string/integer/etc?
|
105
105
|
def decode_json_if_json(value)
|
106
|
-
|
106
|
+
is_json = (value.start_with?('{') && value.end_with?('}')) ||
|
107
|
+
(value.start_with?('[') && value.end_with?(']'))
|
108
|
+
return value unless is_json
|
107
109
|
ActiveSupport::JSON.decode(value)
|
108
110
|
rescue
|
109
111
|
value
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nested-hstore
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-04-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|