audited-mongo_mapper 3.0.0.rc1 → 4.0.0.rc1

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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 63de1dd9ac89de3688aa5ef70ae628765b43c801
4
+ data.tar.gz: f339ca68281a55f0b2cbdb47fe52c26f93496cfb
5
+ SHA512:
6
+ metadata.gz: 6405c766d1386a0d7cd4b3a11a9d25856b515db2f8a0a8bae2ac50271e21883bfbf6d8ade9b745d5ea75fda9d03eff53f6669894177db919552cc269184c595a
7
+ data.tar.gz: 57ea3d495ab30056f9deb8879a0490c345692199853b16d52e7c7735dc130058d3a38c6f0d476dd84edfdf283be0c5efc54f4adff0700976e4086b54a6f959bd
data/LICENSE ADDED
@@ -0,0 +1,19 @@
1
+ Copyright © 2010 Brandon Keepers - Collective Idea
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ THE SOFTWARE.
@@ -25,7 +25,7 @@ module Audited
25
25
  key :user_type, String
26
26
  key :username, String
27
27
  key :action, String
28
- key :audited_changes, Hash
28
+ key :audited_changes, AuditedChanges
29
29
  key :version, Integer, :default => 0
30
30
  key :comment, String
31
31
  key :remote_address, String
@@ -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
@@ -1,5 +1,6 @@
1
1
  require 'mongo_mapper'
2
2
  require 'audited/auditor'
3
+ require 'audited/adapters/mongo_mapper/audited_changes'
3
4
  require 'audited/adapters/mongo_mapper/audit'
4
5
 
5
6
  module Audited::Auditor::ClassMethods
metadata CHANGED
@@ -1,8 +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.rc1
5
- prerelease: 6
4
+ version: 4.0.0.rc1
6
5
  platform: ruby
7
6
  authors:
8
7
  - Brandon Keepers
@@ -14,73 +13,69 @@ authors:
14
13
  autorequire:
15
14
  bindir: bin
16
15
  cert_chain: []
17
- date: 2012-04-25 00:00:00.000000000 Z
16
+ date: 2014-07-30 00:00:00.000000000 Z
18
17
  dependencies:
19
18
  - !ruby/object:Gem::Dependency
20
19
  name: audited
21
20
  requirement: !ruby/object:Gem::Requirement
22
- none: false
23
21
  requirements:
24
22
  - - '='
25
23
  - !ruby/object:Gem::Version
26
- version: 3.0.0.rc1
27
- prerelease: 6
24
+ version: 4.0.0.rc1
28
25
  type: :runtime
29
26
  prerelease: false
30
27
  version_requirements: !ruby/object:Gem::Requirement
31
- none: false
32
28
  requirements:
33
29
  - - '='
34
30
  - !ruby/object:Gem::Version
35
- version: 3.0.0.rc1
36
- prerelease: 6
31
+ version: 4.0.0.rc1
37
32
  - !ruby/object:Gem::Dependency
38
33
  name: mongo_mapper
39
34
  requirement: !ruby/object:Gem::Requirement
40
- none: false
41
35
  requirements:
42
- - - ~>
36
+ - - "~>"
43
37
  - !ruby/object:Gem::Version
44
- version: '0.11'
38
+ version: 0.12.0
45
39
  type: :runtime
46
40
  prerelease: false
47
41
  version_requirements: !ruby/object:Gem::Requirement
48
- none: false
49
42
  requirements:
50
- - - ~>
43
+ - - "~>"
51
44
  - !ruby/object:Gem::Version
52
- version: '0.11'
45
+ version: 0.12.0
53
46
  description: Log all changes to your MongoMapper models
54
47
  email: info@collectiveidea.com
55
48
  executables: []
56
49
  extensions: []
57
50
  extra_rdoc_files: []
58
51
  files:
52
+ - LICENSE
59
53
  - lib/audited-mongo_mapper.rb
60
54
  - lib/audited/adapters/mongo_mapper.rb
61
55
  - lib/audited/adapters/mongo_mapper/audit.rb
56
+ - lib/audited/adapters/mongo_mapper/audited_changes.rb
62
57
  homepage: https://github.com/collectiveidea/audited
63
- licenses: []
58
+ licenses:
59
+ - MIT
60
+ metadata: {}
64
61
  post_install_message:
65
62
  rdoc_options: []
66
63
  require_paths:
67
64
  - lib
68
65
  required_ruby_version: !ruby/object:Gem::Requirement
69
- none: false
70
66
  requirements:
71
- - - ! '>='
67
+ - - ">="
72
68
  - !ruby/object:Gem::Version
73
69
  version: '0'
74
70
  required_rubygems_version: !ruby/object:Gem::Requirement
75
- none: false
76
71
  requirements:
77
- - - ! '>'
72
+ - - ">"
78
73
  - !ruby/object:Gem::Version
79
74
  version: 1.3.1
80
75
  requirements: []
81
76
  rubyforge_project:
82
- rubygems_version: 1.8.21
77
+ rubygems_version: 2.2.2
83
78
  signing_key:
84
- specification_version: 3
79
+ specification_version: 4
85
80
  summary: Log all changes to your MongoMapper models
86
81
  test_files: []