activerecord2-hstore 1.0.2 → 1.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/CHANGELOG CHANGED
@@ -1,3 +1,6 @@
1
+ 1.0.3
2
+ * Corrected ActiveRecord setter to allow for nil input (again)
3
+
1
4
  1.0.2
2
5
  * Corrected ActiveRecord setter to allow for nil input
3
6
 
@@ -28,7 +28,7 @@ module Hstore
28
28
  end
29
29
 
30
30
  define_method "#{column}=".to_sym do |value|
31
- value = {} if value.nil?
31
+ value = {}.to_hstore if value.nil?
32
32
  value ||= value.is_a?(String) ? value : value.to_hstore
33
33
  write_attribute(column.to_sym, value)
34
34
  end
@@ -1,5 +1,5 @@
1
1
  module Activerecord2
2
2
  module Hstore
3
- VERSION = "1.0.2"
3
+ VERSION = "1.0.3"
4
4
  end
5
5
  end
data/spec/hstore_spec.rb CHANGED
@@ -56,7 +56,7 @@ describe Hstore do
56
56
  end
57
57
 
58
58
  it "handles nil input" do
59
- subject.should_receive(:write_attribute)
59
+ subject.should_receive(:write_attribute).with(:some_field, "")
60
60
  subject.some_field = nil
61
61
  end
62
62
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord2-hstore
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 2
10
- version: 1.0.2
9
+ - 3
10
+ version: 1.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Tony Drake