audited-mongo_mapper 3.0.0.rc1 → 3.0.0.rc2
Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,26 @@
|
|
1
|
+
module Audited
|
2
|
+
module Adapters
|
3
|
+
module MongoMapper
|
4
|
+
class AuditedChanges < ::Hash
|
5
|
+
def self.from_mongo(changes)
|
6
|
+
changes.is_a?(Hash) ? new.replace(changes) : changes
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.to_mongo(changes)
|
10
|
+
if changes.is_a?(Hash)
|
11
|
+
changes.inject({}) do |memo, (key, value)|
|
12
|
+
memo[key] = if value.is_a?(Array)
|
13
|
+
value.map{|v| v.class.to_mongo(v) }
|
14
|
+
else
|
15
|
+
value
|
16
|
+
end
|
17
|
+
memo
|
18
|
+
end
|
19
|
+
else
|
20
|
+
changes
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: audited-mongo_mapper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.0.
|
4
|
+
version: 3.0.0.rc2
|
5
5
|
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -14,7 +14,7 @@ authors:
|
|
14
14
|
autorequire:
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
|
-
date: 2012-
|
17
|
+
date: 2012-07-09 00:00:00.000000000 Z
|
18
18
|
dependencies:
|
19
19
|
- !ruby/object:Gem::Dependency
|
20
20
|
name: audited
|
@@ -23,7 +23,7 @@ dependencies:
|
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 3.0.0.
|
26
|
+
version: 3.0.0.rc2
|
27
27
|
prerelease: 6
|
28
28
|
type: :runtime
|
29
29
|
prerelease: false
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
requirements:
|
33
33
|
- - '='
|
34
34
|
- !ruby/object:Gem::Version
|
35
|
-
version: 3.0.0.
|
35
|
+
version: 3.0.0.rc2
|
36
36
|
prerelease: 6
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
name: mongo_mapper
|
@@ -59,6 +59,7 @@ files:
|
|
59
59
|
- lib/audited-mongo_mapper.rb
|
60
60
|
- lib/audited/adapters/mongo_mapper.rb
|
61
61
|
- lib/audited/adapters/mongo_mapper/audit.rb
|
62
|
+
- lib/audited/adapters/mongo_mapper/audited_changes.rb
|
62
63
|
homepage: https://github.com/collectiveidea/audited
|
63
64
|
licenses: []
|
64
65
|
post_install_message:
|
@@ -71,6 +72,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
71
72
|
- - ! '>='
|
72
73
|
- !ruby/object:Gem::Version
|
73
74
|
version: '0'
|
75
|
+
segments:
|
76
|
+
- 0
|
77
|
+
hash: 455350738459127187
|
74
78
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
75
79
|
none: false
|
76
80
|
requirements:
|
@@ -79,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
79
83
|
version: 1.3.1
|
80
84
|
requirements: []
|
81
85
|
rubyforge_project:
|
82
|
-
rubygems_version: 1.8.
|
86
|
+
rubygems_version: 1.8.24
|
83
87
|
signing_key:
|
84
88
|
specification_version: 3
|
85
89
|
summary: Log all changes to your MongoMapper models
|