couch_potato 0.2.17 → 0.2.18

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES.md CHANGED
@@ -1,5 +1,8 @@
1
1
  ## Changes
2
2
 
3
+ ### 0.2.18
4
+ * set Fixnum property to nil when given a blank string (langalex)
5
+
3
6
  ### 0.2.17
4
7
  * fixed nil attributes were omitted in json (jweiss, mattmatt)
5
8
  * support for properties of type Fixnum (langalex)
data/VERSION.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
2
  :build:
3
3
  :minor: 2
4
- :patch: 17
4
+ :patch: 18
5
5
  :major: 0
@@ -4,7 +4,7 @@ module CouchPotato
4
4
  def cast(value, type)
5
5
  if type && !value.instance_of?(type)
6
6
  if type == Fixnum
7
- value.to_s.scan(/\d/).join.to_i unless value.nil?
7
+ value.to_s.scan(/\d/).join.to_i unless value.blank?
8
8
  else
9
9
  type.json_create value
10
10
  end
@@ -76,6 +76,10 @@ describe "attributes" do
76
76
  @plant.typed_leaf_count.should == 123
77
77
  end
78
78
 
79
+ it "should set the attributes to nil if given a blank string" do
80
+ @plant.typed_leaf_count = ''
81
+ @plant.typed_leaf_count.should be_nil
82
+ end
79
83
  end
80
84
  end
81
85
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: couch_potato
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.17
4
+ version: 0.2.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Lang