act_as_dirty 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG.md +4 -0
- data/lib/act_as_dirty/active_model/cleaner.rb +8 -0
- data/lib/act_as_dirty/version.rb +1 -1
- metadata +3 -3
data/CHANGELOG.md
CHANGED
@@ -34,6 +34,7 @@ module ActAsDirty
|
|
34
34
|
|
35
35
|
def generate_message record, attribute
|
36
36
|
changes = record.read_changes_for_cleaning(attribute)
|
37
|
+
changes = format_values(changes) if @options[:using]
|
37
38
|
if record.new_record?
|
38
39
|
if @options[:create]
|
39
40
|
message = @options[:create].call(record)
|
@@ -48,6 +49,13 @@ module ActAsDirty
|
|
48
49
|
message
|
49
50
|
end
|
50
51
|
|
52
|
+
def format_values changes
|
53
|
+
if @options[:using] and @options[:using].is_a? Array
|
54
|
+
changes = [@options[:using][changes[0]], @options[:using][changes[1]]]
|
55
|
+
end
|
56
|
+
changes
|
57
|
+
end
|
58
|
+
|
51
59
|
end
|
52
60
|
end
|
53
61
|
|
data/lib/act_as_dirty/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: act_as_dirty
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-02-29 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement: &
|
16
|
+
requirement: &5930820 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *5930820
|
25
25
|
description: Keep a log of what every user does on your system. Very useful in CRM,
|
26
26
|
it would allow you to easily keep track of what every user has done to the record.
|
27
27
|
email:
|