property_sets 0.7.1 → 0.7.2

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/property_sets.rb CHANGED
@@ -3,7 +3,7 @@ require 'property_sets/active_record_extension'
3
3
  require 'property_sets/action_view_extension'
4
4
 
5
5
  module PropertySets
6
- VERSION = "0.7.1"
6
+ VERSION = "0.7.2"
7
7
 
8
8
  def self.ensure_property_set_class(association, owner_class)
9
9
  const_name = "#{owner_class.name}#{association.to_s.singularize.capitalize}".to_sym
@@ -27,7 +27,7 @@ module PropertySets
27
27
  def value
28
28
  if value_serialized
29
29
  v = read_attribute(:value)
30
- return nil if v == "null"
30
+ return nil if v.nil? || v == "null"
31
31
  @deserialized_value ||= JSON.parse(v)
32
32
  else
33
33
  super
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
13
13
  ## If your rubyforge_project name is different, then edit it and comment out
14
14
  ## the sub! line in the Rakefile
15
15
  s.name = 'property_sets'
16
- s.version = '0.7.1'
16
+ s.version = '0.7.2'
17
17
  s.date = '2012-04-09'
18
18
  s.rubyforge_project = 'property_sets'
19
19
 
@@ -325,10 +325,14 @@ class TestPropertySets < ActiveSupport::TestCase
325
325
  assert_equal 3, @account.typed_data.serialized_prop[:c]
326
326
  end
327
327
 
328
- should "deal with nil values properly" do
328
+ should "deal with nil values properly going in" do
329
329
  @account.typed_data.serialized_prop = nil
330
330
  @account.save!
331
331
  end
332
+
333
+ should "deal with nil values properly coming out" do
334
+ assert_equal nil, @account.typed_data.serialized_prop
335
+ end
332
336
  end
333
337
  end
334
338
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: property_sets
3
3
  version: !ruby/object:Gem::Version
4
- hash: 1
4
+ hash: 7
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 7
9
- - 1
10
- version: 0.7.1
9
+ - 2
10
+ version: 0.7.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Morten Primdahl