cia 0.5.4 → 0.5.5
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/gemfiles/rails2.gemfile.lock +1 -1
- data/gemfiles/rails3.gemfile.lock +1 -1
- data/lib/cia.rb +4 -1
- data/lib/cia/version.rb +1 -1
- data/spec/cia_spec.rb +8 -0
- metadata +4 -4
data/Gemfile.lock
CHANGED
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
|
-
|
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
|
|
data/lib/cia/version.rb
CHANGED
data/spec/cia_spec.rb
CHANGED
@@ -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
|
+
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-
|
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:
|
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:
|
82
|
+
hash: 948177478462365006
|
83
83
|
requirements: []
|
84
84
|
rubyforge_project:
|
85
85
|
rubygems_version: 1.8.25
|