has_serialized 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,7 @@
1
+ # 1.1.1
2
+
3
+ - Do not set default value if the value has already been set (even if it was set to nil)
4
+
1
5
  # 1.1.0
2
6
 
3
7
  - Create `getter?` methods for attributes with default boolean values
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- has_serialized (1.1.0)
4
+ has_serialized (1.1.1)
5
5
  activerecord (~> 3.0)
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: /Users/dev/src/has_serialized
3
3
  specs:
4
- has_serialized (1.1.0)
4
+ has_serialized (1.1.1)
5
5
  activerecord (~> 3.0)
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: /Users/dev/src/has_serialized
3
3
  specs:
4
- has_serialized (1.1.0)
4
+ has_serialized (1.1.1)
5
5
  activerecord (~> 3.0)
6
6
 
7
7
  GEM
@@ -36,7 +36,7 @@ module HasSerialized
36
36
  define_method(method_name) do
37
37
  accessors.each do |key, default_value|
38
38
  self[serialized] ||= {}
39
- if self[serialized][key].nil?
39
+ unless self[serialized].has_key?(key)
40
40
  self[serialized][key] = default_value
41
41
  end
42
42
  end
@@ -1,3 +1,3 @@
1
1
  module HasSerialized
2
- VERSION = '1.1.0'
2
+ VERSION = '1.1.1'
3
3
  end
@@ -21,10 +21,11 @@ describe HasSerialized do
21
21
  end
22
22
 
23
23
  it 'should be able to override certain defaults during instantiation' do
24
- page = Page.new(gunslinger: 'Roland', jake: false)
24
+ page = Page.new(gunslinger: 'Roland', jake: false, ka_tet: nil)
25
25
  expect(page.gunslinger).to eq('Roland')
26
26
  expect(page.lowmen).to be_true
27
27
  expect(page.jake).to eq(false)
28
+ expect(page.ka_tet).to be_nil
28
29
  end
29
30
 
30
31
  it 'should create getters that end with question marks for boolean fields' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: has_serialized
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -119,7 +119,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
119
119
  version: '0'
120
120
  segments:
121
121
  - 0
122
- hash: 3198233213287663380
122
+ hash: -1846763445347575345
123
123
  required_rubygems_version: !ruby/object:Gem::Requirement
124
124
  none: false
125
125
  requirements: