mongoid-audit 1.0.0 → 1.0.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.
- checksums.yaml +4 -4
- data/Gemfile.lock +38 -21
- data/README.md +12 -4
- data/lib/mongoid-audit.rb +0 -1
- data/lib/mongoid-audit/railtie.rb +3 -1
- data/lib/mongoid-audit/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7e5fd4060db6a6d7b43f31ac376e1d573c888e21
|
|
4
|
+
data.tar.gz: 6d4ebab3492061ff8ec0ddb116220f6b7f6c49de
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 285266f255f6703747b09baeb3ad7fc5e303e49831806b752e3ec59ea07112938d568f5ae76c929d9433c0ecff70905b63a6f3736535fa4316837799c949da54
|
|
7
|
+
data.tar.gz: 61c212a3f35112ff767492f055f6dc45b57e63baefdd42a33ef37416944fae6c74832f934214f4f63cb3d64391d52b08b68a318d42872242dae8213e67b45f3d
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
mongoid-audit (1.0.
|
|
4
|
+
mongoid-audit (1.0.1)
|
|
5
5
|
activesupport
|
|
6
6
|
glebtv_mongoid_userstamp
|
|
7
7
|
kaminari
|
|
@@ -11,37 +11,44 @@ PATH
|
|
|
11
11
|
GEM
|
|
12
12
|
remote: https://rubygems.org/
|
|
13
13
|
specs:
|
|
14
|
-
actionpack (4.
|
|
15
|
-
actionview (= 4.
|
|
16
|
-
activesupport (= 4.
|
|
17
|
-
rack (~> 1.
|
|
14
|
+
actionpack (4.2.0)
|
|
15
|
+
actionview (= 4.2.0)
|
|
16
|
+
activesupport (= 4.2.0)
|
|
17
|
+
rack (~> 1.6.0)
|
|
18
18
|
rack-test (~> 0.6.2)
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
|
20
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.1)
|
|
21
|
+
actionview (4.2.0)
|
|
22
|
+
activesupport (= 4.2.0)
|
|
21
23
|
builder (~> 3.1)
|
|
22
24
|
erubis (~> 2.7.0)
|
|
23
|
-
|
|
24
|
-
|
|
25
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
|
26
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.1)
|
|
27
|
+
activemodel (4.2.0)
|
|
28
|
+
activesupport (= 4.2.0)
|
|
25
29
|
builder (~> 3.1)
|
|
26
|
-
activesupport (4.
|
|
27
|
-
i18n (~> 0.
|
|
30
|
+
activesupport (4.2.0)
|
|
31
|
+
i18n (~> 0.7)
|
|
28
32
|
json (~> 1.7, >= 1.7.7)
|
|
29
33
|
minitest (~> 5.1)
|
|
30
|
-
thread_safe (~> 0.
|
|
34
|
+
thread_safe (~> 0.3, >= 0.3.4)
|
|
31
35
|
tzinfo (~> 1.1)
|
|
32
36
|
bson (2.3.0)
|
|
33
37
|
builder (3.2.2)
|
|
34
|
-
connection_pool (2.
|
|
35
|
-
easy_diff (0.0.
|
|
38
|
+
connection_pool (2.1.0)
|
|
39
|
+
easy_diff (0.0.4)
|
|
36
40
|
erubis (2.7.0)
|
|
37
41
|
glebtv_mongoid_userstamp (0.4.1)
|
|
38
42
|
mongoid (~> 4.0.0.beta1)
|
|
39
|
-
i18n (0.
|
|
40
|
-
json (1.8.
|
|
43
|
+
i18n (0.7.0)
|
|
44
|
+
json (1.8.2)
|
|
41
45
|
kaminari (0.16.1)
|
|
42
46
|
actionpack (>= 3.0.0)
|
|
43
47
|
activesupport (>= 3.0.0)
|
|
44
|
-
|
|
48
|
+
loofah (2.0.1)
|
|
49
|
+
nokogiri (>= 1.5.9)
|
|
50
|
+
mini_portile (0.6.2)
|
|
51
|
+
minitest (5.5.1)
|
|
45
52
|
mongoid (4.0.0)
|
|
46
53
|
activemodel (~> 4.0)
|
|
47
54
|
moped (~> 2.0.0)
|
|
@@ -51,16 +58,26 @@ GEM
|
|
|
51
58
|
activesupport
|
|
52
59
|
easy_diff
|
|
53
60
|
mongoid (>= 3.0)
|
|
54
|
-
moped (2.0.
|
|
61
|
+
moped (2.0.3)
|
|
55
62
|
bson (~> 2.2)
|
|
56
63
|
connection_pool (~> 2.0)
|
|
57
64
|
optionable (~> 0.2.0)
|
|
65
|
+
nokogiri (1.6.5)
|
|
66
|
+
mini_portile (~> 0.6.0)
|
|
58
67
|
optionable (0.2.0)
|
|
59
68
|
origin (2.1.1)
|
|
60
|
-
rack (1.
|
|
61
|
-
rack-test (0.6.
|
|
69
|
+
rack (1.6.0)
|
|
70
|
+
rack-test (0.6.3)
|
|
62
71
|
rack (>= 1.0)
|
|
63
|
-
|
|
72
|
+
rails-deprecated_sanitizer (1.0.3)
|
|
73
|
+
activesupport (>= 4.2.0.alpha)
|
|
74
|
+
rails-dom-testing (1.0.5)
|
|
75
|
+
activesupport (>= 4.2.0.beta, < 5.0)
|
|
76
|
+
nokogiri (~> 1.6.0)
|
|
77
|
+
rails-deprecated_sanitizer (>= 1.0.1)
|
|
78
|
+
rails-html-sanitizer (1.0.1)
|
|
79
|
+
loofah (~> 2.0)
|
|
80
|
+
rake (10.4.2)
|
|
64
81
|
thread_safe (0.3.4)
|
|
65
82
|
tzinfo (1.2.2)
|
|
66
83
|
thread_safe (~> 0.1)
|
data/README.md
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
[](http://badge.fury.io/rb/mongoid-audit)
|
|
4
4
|
[](https://www.versioneye.com/user/projects/53ea131f8b6db55f150000b7)
|
|
5
|
-
[](https://github.com/rs-pro/mongoid-audit/issues)
|
|
6
5
|
[](https://github.com/rs-pro/mongoid-audit/blob/master/MIT-LICENSE.txt)
|
|
7
6
|
|
|
8
7
|
**MongoidAudit 1.0 is a complete rewrite and might break backwards compatibility**
|
|
@@ -25,7 +24,7 @@ include Trackable
|
|
|
25
24
|
```
|
|
26
25
|
3) Database storage format for user / modifier in 1.0.0 was changed, since now [glebtv_mongoid_userstamp](https://github.com/glebtv/mongoid_userstamp) gem is used to store modifier. To migrate your data you should do something like:
|
|
27
26
|
|
|
28
|
-
HistoryTracker.all.each{|ht| ht.rename(:
|
|
27
|
+
HistoryTracker.all.each{|ht| ht.rename(modifier_id: :updater_id)}
|
|
29
28
|
|
|
30
29
|
4) This gem includes storing modifier, but it is done via ```glebtv_mongoid_userstamp``` and not directly.
|
|
31
30
|
|
|
@@ -36,7 +35,7 @@ include Trackable
|
|
|
36
35
|
Add this line to your application's Gemfile:
|
|
37
36
|
|
|
38
37
|
# must be after rails_admin, if you use it
|
|
39
|
-
gem 'mongoid-audit', '~> 1.0.0
|
|
38
|
+
gem 'mongoid-audit', '~> 1.0.0'
|
|
40
39
|
|
|
41
40
|
And then execute:
|
|
42
41
|
|
|
@@ -44,7 +43,7 @@ And then execute:
|
|
|
44
43
|
|
|
45
44
|
Or install it yourself as:
|
|
46
45
|
|
|
47
|
-
$ gem install mongoid-audit
|
|
46
|
+
$ gem install mongoid-audit
|
|
48
47
|
|
|
49
48
|
## Usage
|
|
50
49
|
|
|
@@ -67,6 +66,15 @@ See https://github.com/aq1018/mongoid-history
|
|
|
67
66
|
except: ["created_at", "updated_at", "c_at", "u_at", "clicks", "impressions", "some_other_your_field"],
|
|
68
67
|
})
|
|
69
68
|
|
|
69
|
+
### Setting modifier class name
|
|
70
|
+
|
|
71
|
+
Add to an initializer:
|
|
72
|
+
|
|
73
|
+
Mongoid::History.modifier_class_name = 'Author'
|
|
74
|
+
Mongoid::Userstamp.config do |c|
|
|
75
|
+
c.user_reader = :current_admin
|
|
76
|
+
c.user_model = :admin
|
|
77
|
+
end
|
|
70
78
|
|
|
71
79
|
### Rails Admin Integration
|
|
72
80
|
|
data/lib/mongoid-audit.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mongoid-audit
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Gleb Tv
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2015-01-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: mongoid
|
|
@@ -151,7 +151,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
151
151
|
version: '0'
|
|
152
152
|
requirements: []
|
|
153
153
|
rubyforge_project:
|
|
154
|
-
rubygems_version: 2.
|
|
154
|
+
rubygems_version: 2.4.5
|
|
155
155
|
signing_key:
|
|
156
156
|
specification_version: 4
|
|
157
157
|
summary: Easily track model change history and mantain audit log with mongoid
|