dm-is-audited 0.1.0 → 0.1.1
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/README.md +4 -0
- data/VERSION +1 -1
- data/dm-is-audited.gemspec +2 -2
- data/lib/dm-is-audited/is/audited/resource.rb +2 -2
- metadata +4 -4
data/README.md
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
Plugin for DataMapper to allow for simple auditing of models. This plugin does not implement auditing itself, but creates a block context in which you can implement your own auditing procedures.
|
4
4
|
|
5
|
+
## Install
|
6
|
+
|
7
|
+
gem install dm-is-audited
|
8
|
+
|
5
9
|
## Example
|
6
10
|
|
7
11
|
Each time a person is created, updated, or destroyed the block passed to audit will be evaluated in the context of the changed resource. Use the `action` parameter and the resource method `changes` to construct your audit logs.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
data/dm-is-audited.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{dm-is-audited}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Alex Gibbons"]
|
12
|
-
s.date = %q{2010-12-
|
12
|
+
s.date = %q{2010-12-20}
|
13
13
|
s.description = %q{Plugin for DataMapper to allow for simple auditing of models. This plugin does not implement auditing itself, but creates a block context in which you can implement your own auditing procedures.}
|
14
14
|
s.email = %q{alex.gibbons [a] gmail [dot] com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -5,9 +5,9 @@ module DataMapper
|
|
5
5
|
|
6
6
|
def changes
|
7
7
|
if @audited_original_attributes
|
8
|
-
@audited_original_attributes.merge(@audited_original_attributes)
|
8
|
+
@audited_original_attributes.merge(@audited_original_attributes) { |property, value|
|
9
9
|
[value, attribute_get(property.name)] if attribute_get(property.name) != value
|
10
|
-
|
10
|
+
}.delete_if {|k,v| v.nil?}
|
11
11
|
else
|
12
12
|
{}
|
13
13
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dm-is-audited
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 1
|
10
|
+
version: 0.1.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Alex Gibbons
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-12-
|
18
|
+
date: 2010-12-20 00:00:00 -08:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|