active_record_serialize_json 0.1.0 → 0.1.1

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/CHANGES CHANGED
@@ -1,3 +1,5 @@
1
+ 2011-05-31 - 0.1.1
2
+ * Do not store non JSON documents into the column.
1
3
  2011-05-27 - 0.1.0
2
4
  * Now Rails 2 and 3 compatible
3
5
  2011-03-21 - 0.0.2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -33,7 +33,8 @@ module ActiveRecord
33
33
 
34
34
  def self.serialize(value, opts = {})
35
35
  opts ||= {}
36
- value.to_json(opts)
36
+ result = value.to_json(opts)
37
+ result =~ /\A\s*[{\[]/ and result
37
38
  end
38
39
 
39
40
  def self.deserialize(value, opts = {})
@@ -1,7 +1,7 @@
1
1
  module ActiveRecord
2
2
  module SerializeJSON
3
3
  # ActiveRecord::SerializeJSON version
4
- VERSION = '0.1.0'
4
+ VERSION = '0.1.1'
5
5
  VERSION_ARRAY = VERSION.split(/\./).map { |x| x.to_i } # :nodoc:
6
6
  VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
7
7
  VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_record_serialize_json
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 0
10
- version: 0.1.0
9
+ - 1
10
+ version: 0.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Florian Frank
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-05-27 00:00:00 +02:00
18
+ date: 2011-05-31 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency