mongoid_alize 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -30,7 +30,7 @@ module Mongoid
30
30
  def define_fields
31
31
  ensure_field_not_defined!(prefixed_name, klass)
32
32
  klass.class_eval <<-CALLBACK, __FILE__, __LINE__ + 1
33
- field :#{prefixed_name}, :type => Hash, :default => nil
33
+ field :#{prefixed_name}, :type => Hash, :default => {}
34
34
  CALLBACK
35
35
 
36
36
  define_fields_method
@@ -21,10 +21,10 @@ describe Mongoid::Alize::Callbacks::From::One do
21
21
  Head.fields["person_fields"].type.should == Hash
22
22
  end
23
23
 
24
- it "should default the field to nil" do
24
+ it "should default the field to empty" do
25
25
  callback = new_callback
26
26
  callback.send(:define_fields)
27
- Head.new.person_fields.should be_nil
27
+ Head.new.person_fields.should == {}
28
28
  end
29
29
 
30
30
  it "should raise an already defined field error if the field already exists" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongoid_alize
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:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-11 00:00:00.000000000 Z
12
+ date: 2013-07-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mongoid