mongoid-audit_log 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- OTQ2YWM3MzI1ZTRlMjZjOTZhOWRjN2E5ZTFhOWY4NTRiZGFlNGQyZQ==
4
+ OWZjYTAzMDFlNmIzYjhiN2M0N2M0ZTRiNWZiZjFiNmM2M2E0NDU1Ng==
5
5
  data.tar.gz: !binary |-
6
- NGU3Njg2NDY2MGM1ZTY4YzFlM2E5MTY4MDI4MmFmZTA5ODgwMzRkOQ==
6
+ MWUwZDQyYzgyOGNiMGQ5OGI2OTM4YTg4Yzg4N2YwYjg2OTg3MWQ2ZQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- Mjc3MzBlNmY5NTIxZjhjZDI5MDZkZTQxZDc3OGJjMDNlMDQ2ZmE2MjBiNTgy
10
- Yjk3MDAxZjliY2NiYjMzMmNhMjZjMTE2ZDRjODA5ZTMzNzBiZGY1MWUwZjZi
11
- MTFkYjkxZjhkZDgxNjYwNTNmMDRlNTVjYWNiOGMwYmJlMzI0ZDM=
9
+ MjhmZWIxMDQ3ZjUyNDAyYzRiZDMzZTY0YTExNDhkMDhjYWU4ODNjODI3NGJh
10
+ NzkwZjYzMWJjNTk4OWMxMzAzNTNjOTkwOTE5ZTZhODAxOGUwMjVlM2QwNTgw
11
+ NzlkNjFjNGRkMGQzYzg3ZDZhZDM1YTZmMjhjMGY1NmNlZmM5Mjg=
12
12
  data.tar.gz: !binary |-
13
- NjIxNTUxYTZhOGY3OTE1ZTEyM2VkOWMyYjJjMDdhZmYwZTc4YmY3M2U5YzIy
14
- MDExYTFhY2ZmYmY1ZmYyMmQ0ZTRiZTlhMGNkN2I1ZjY1OTZiMDVlNDEyYTE3
15
- N2Y5YTQzNGRiZWFhYWFiZWU2NDg5NmIyODE2NzU1MTMwNzQ1OWU=
13
+ ZDA0Mjk4N2QwM2JiOTY2NjJjOTA4ZGQzMjAzY2YyNWFlNmFjODAzODZmOWI5
14
+ NDNkNTZkOWQ5NzJmOThmMjhlYTU3MjUyYmM2YWZiNTUxYjU3ODQ4MDlmNDZk
15
+ MmRiYzVmMzdkZjc2Y2YzMWZlNTgwMmM5ZmU4NjdiMzJkZWY1MjQ=
@@ -48,7 +48,7 @@ module Mongoid
48
48
  end
49
49
 
50
50
  def all
51
- @all ||= if !model.changed?
51
+ @all ||= if model.blank? || !model.changed?
52
52
  {}
53
53
  else
54
54
  result = model.changes
@@ -1,5 +1,5 @@
1
1
  module Mongoid
2
2
  module AuditLog
3
- VERSION = "0.0.5"
3
+ VERSION = "0.0.6"
4
4
  end
5
5
  end
@@ -55,6 +55,10 @@ module Mongoid
55
55
  Changes.new(product).all
56
56
  end
57
57
 
58
+ it 'is empty if the model is nil' do
59
+ Changes.new(nil).all.should == {}
60
+ end
61
+
58
62
  it 'has model changes' do
59
63
  changes['name'].should == [nil, 'Foo bar']
60
64
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongoid-audit_log
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Crouse
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-15 00:00:00.000000000 Z
11
+ date: 2013-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mongoid