nano-store 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -45,7 +45,11 @@ module NanoStore
45
45
  end
46
46
 
47
47
  define_method((name + "=").to_sym) do |*args, &block|
48
- self.info[name] = args[0]
48
+ if args[0].nil?
49
+ self.info.delete(name.to_sym)
50
+ else
51
+ self.info[name] = args[0]
52
+ end
49
53
  end
50
54
  end
51
55
 
@@ -1,3 +1,3 @@
1
1
  module NanoStore
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  end
data/spec/model_spec.rb CHANGED
@@ -44,6 +44,12 @@ describe NanoStore::Model do
44
44
  User.count.should == 1
45
45
  end
46
46
 
47
+ it "create object with nil field" do
48
+ user = stub_user("Bob", 10, nil)
49
+ user.save
50
+ user.key.should.not.be.nil
51
+ end
52
+
47
53
  it "create object with initializer" do
48
54
  name = "Abby"
49
55
  age = 30
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nano-store
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -190,7 +190,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
190
190
  version: '0'
191
191
  segments:
192
192
  - 0
193
- hash: -2617493902001633964
193
+ hash: -557575853161670101
194
194
  required_rubygems_version: !ruby/object:Gem::Requirement
195
195
  none: false
196
196
  requirements:
@@ -199,7 +199,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
199
199
  version: '0'
200
200
  segments:
201
201
  - 0
202
- hash: -2617493902001633964
202
+ hash: -557575853161670101
203
203
  requirements: []
204
204
  rubyforge_project:
205
205
  rubygems_version: 1.8.24