active_record_serialize_json 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.3
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "active_record_serialize_json"
5
- s.version = "0.1.2"
5
+ s.version = "0.1.3"
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"]
9
- s.date = "2011-12-09"
9
+ s.date = "2012-01-26"
10
10
  s.description = "Serialize an ActiveRecord::Base attribute via JSON in Ruby on Rails"
11
11
  s.email = "flori@ping.de"
12
12
  s.extra_rdoc_files = ["README.rdoc", "lib/active_record/serialize_json/version.rb", "lib/active_record/serialize_json.rb", "lib/active_record_serialize_json.rb"]
@@ -14,7 +14,7 @@ Gem::Specification.new do |s|
14
14
  s.homepage = "http://github.com/flori/active_record_serialize_json"
15
15
  s.rdoc_options = ["--title", "ActiveRecordSerializeJson - Serialize an ActiveRecord::Base attribute via JSON", "--main", "README.rdoc"]
16
16
  s.require_paths = ["lib"]
17
- s.rubygems_version = "1.8.10"
17
+ s.rubygems_version = "1.8.15"
18
18
  s.summary = "Serialize an ActiveRecord::Base attribute via JSON"
19
19
  s.test_files = ["test/serialize_json_test.rb"]
20
20
 
@@ -34,13 +34,21 @@ module ActiveRecord
34
34
  end
35
35
 
36
36
  def self.serialize(value, opts = {})
37
- opts ||= {}
37
+ opts ||= {
38
+ :max_nesting => false,
39
+ :allow_nan => true,
40
+ :quirks_mode => true,
41
+ }
38
42
  result = JSON(value, opts)
39
43
  result =~ /\A\s*[{\[]/ and result
40
44
  end
41
45
 
42
46
  def self.deserialize(value, opts = {})
43
- opts ||= {}
47
+ opts ||= {
48
+ :max_nesting => false,
49
+ :allow_nan => true,
50
+ :quirks_mode => true,
51
+ }
44
52
  JSON.parse(value, opts)
45
53
  rescue => e
46
54
  if defined?(::Rails)
@@ -1,6 +1,6 @@
1
1
  class ActiveRecord::SerializeJSON
2
2
  # ActiveRecord::SerializeJSON version
3
- VERSION = '0.1.2'
3
+ VERSION = '0.1.3'
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: 31
4
+ hash: 29
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 2
10
- version: 0.1.2
9
+ - 3
10
+ version: 0.1.3
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-12-09 00:00:00 Z
18
+ date: 2012-01-26 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: gem_hadar
@@ -136,7 +136,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
136
  requirements: []
137
137
 
138
138
  rubyforge_project:
139
- rubygems_version: 1.8.10
139
+ rubygems_version: 1.8.15
140
140
  signing_key:
141
141
  specification_version: 3
142
142
  summary: Serialize an ActiveRecord::Base attribute via JSON