mongoid-audit 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6110f867cfbe6c4f85a26e024bb199318a8cde3d
4
- data.tar.gz: cc04342cab7ee764db39faa22dfb27d67f47d942
3
+ metadata.gz: 7e5fd4060db6a6d7b43f31ac376e1d573c888e21
4
+ data.tar.gz: 6d4ebab3492061ff8ec0ddb116220f6b7f6c49de
5
5
  SHA512:
6
- metadata.gz: 710235e1c4ba7383e4aacf65230fe7586e8f3e67972ed827c81f8b0f63e7f9b48bf08fc882991465feb8dacd371017c5de76ed6dfc648e4cd2375c46ac8a77e7
7
- data.tar.gz: 3c7c560f550cdd5951a24c8b4a61d51202d131c169f033f1e2b32615810993049fb67ce3a5655c1febf4a41ceb16f6c89c10b017cb0bc6040831dc6993eb7cfd
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.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.1.5)
15
- actionview (= 4.1.5)
16
- activesupport (= 4.1.5)
17
- rack (~> 1.5.2)
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
- actionview (4.1.5)
20
- activesupport (= 4.1.5)
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
- activemodel (4.1.5)
24
- activesupport (= 4.1.5)
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.1.5)
27
- i18n (~> 0.6, >= 0.6.9)
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.1)
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.0.0)
35
- easy_diff (0.0.3)
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.6.11)
40
- json (1.8.1)
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
- minitest (5.4.0)
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.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.5.2)
61
- rack-test (0.6.2)
69
+ rack (1.6.0)
70
+ rack-test (0.6.3)
62
71
  rack (>= 1.0)
63
- rake (10.3.2)
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
  [![Gem Version](https://badge.fury.io/rb/mongoid-audit.png)](http://badge.fury.io/rb/mongoid-audit)
4
4
  [![Dependency Status](https://www.versioneye.com/user/projects/53ea131f8b6db55f150000b7/badge.svg)](https://www.versioneye.com/user/projects/53ea131f8b6db55f150000b7)
5
- [![Issues](http://img.shields.io/github/issues/rs-pro/mongoid-audit.svg)](https://github.com/rs-pro/mongoid-audit/issues)
6
5
  [![License](http://img.shields.io/:license-mit-blue.svg)](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(:modifier_id, :updater_id)
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.alpha.1'
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 --pre
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
@@ -7,7 +7,6 @@ require 'kaminari/models/mongoid_extension'
7
7
 
8
8
  require 'mongoid-audit/version'
9
9
  require 'mongoid-audit/trackable'
10
- require 'mongoid-audit/history_tracker'
11
10
  require 'mongoid-audit/railtie'
12
11
 
13
12
  begin; require 'rails_admin'; rescue LoadError; end
@@ -1,7 +1,9 @@
1
1
  module Mongoid::Audit
2
2
  class Railtie < Rails::Railtie
3
+ config.after_initialize do
4
+ require 'mongoid-audit/history_tracker'
5
+ end
3
6
  initializer "mongoid_audit.setup" do
4
- #require_dependency 'history_tracker.rb' if Rails.env.development?
5
7
  end
6
8
  end
7
9
  end
@@ -1,5 +1,5 @@
1
1
  module Mongoid
2
2
  module Audit
3
- VERSION = "1.0.0"
3
+ VERSION = "1.0.1"
4
4
  end
5
5
  end
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.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: 2014-09-19 00:00:00.000000000 Z
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.2.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