cia 0.5.4 → 0.5.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cia (0.5.4)
4
+ cia (0.5.5)
5
5
  json
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: /Users/mgrosser/code/tools/cia
3
3
  specs:
4
- cia (0.5.3)
4
+ cia (0.5.4)
5
5
  json
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: /Users/mgrosser/code/tools/cia
3
3
  specs:
4
- cia (0.5.3)
4
+ cia (0.5.4)
5
5
  json
6
6
 
7
7
  GEM
data/lib/cia.rb CHANGED
@@ -39,7 +39,10 @@ module CIA
39
39
  return if options and options[:unless] and source.send(options[:unless])
40
40
 
41
41
  changes = (source.cia_previous_changes || source.cia_changes).slice(*source.class.audited_attributes)
42
- message = source.audit_message.presence if source.respond_to?(:audit_message)
42
+ if source.respond_to?(:audit_message)
43
+ message = source.audit_message.presence
44
+ source.audit_message = nil
45
+ end
43
46
 
44
47
  return if not message and changes.empty? and action.to_s == "update"
45
48
 
@@ -1,3 +1,3 @@
1
1
  module CIA
2
- VERSION = '0.5.4'
2
+ VERSION = '0.5.5'
3
3
  end
@@ -283,6 +283,14 @@ describe CIA do
283
283
  parse_event_changes(event).should == []
284
284
  end
285
285
 
286
+ it "does not record after saving with an audit_message" do
287
+ source = CarWithAMessage.create!
288
+ source.audit_message = "Foo"
289
+ CIA.record(:update, source)
290
+
291
+ no_audit_created!{ CIA.record(:update, source) }
292
+ end
293
+
286
294
  it "does not record if it's empty and there are no changes" do
287
295
  source = CarWithAMessage.create!
288
296
  source.audit_message = " "
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cia
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.4
4
+ version: 0.5.5
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: 2013-05-28 00:00:00.000000000 Z
12
+ date: 2013-07-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json
@@ -70,7 +70,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
70
70
  version: '0'
71
71
  segments:
72
72
  - 0
73
- hash: 1152273165294657851
73
+ hash: 948177478462365006
74
74
  required_rubygems_version: !ruby/object:Gem::Requirement
75
75
  none: false
76
76
  requirements:
@@ -79,7 +79,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
79
79
  version: '0'
80
80
  segments:
81
81
  - 0
82
- hash: 1152273165294657851
82
+ hash: 948177478462365006
83
83
  requirements: []
84
84
  rubyforge_project:
85
85
  rubygems_version: 1.8.25