active_record_serialize_json 0.1.3 → 0.1.4

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/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.3
1
+ 0.1.4
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "active_record_serialize_json"
5
- s.version = "0.1.3"
5
+ s.version = "0.1.4"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Florian Frank"]
@@ -49,7 +49,11 @@ module ActiveRecord
49
49
  :allow_nan => true,
50
50
  :quirks_mode => true,
51
51
  }
52
- JSON.parse(value, opts)
52
+ if value.to_s.strip.empty?
53
+ nil
54
+ else
55
+ JSON.parse(value, opts)
56
+ end
53
57
  rescue => e
54
58
  if defined?(::Rails)
55
59
  ::Rails.logger.warn e
@@ -1,6 +1,6 @@
1
1
  class ActiveRecord::SerializeJSON
2
2
  # ActiveRecord::SerializeJSON version
3
- VERSION = '0.1.3'
3
+ VERSION = '0.1.4'
4
4
  VERSION_ARRAY = VERSION.split(/\./).map { |x| x.to_i } # :nodoc:
5
5
  VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
6
6
  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: 29
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 3
10
- version: 0.1.3
9
+ - 4
10
+ version: 0.1.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Florian Frank