mongoid-history 0.4.4 → 0.4.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -71
- data/.rubocop_todo.yml +61 -0
- data/.travis.yml +3 -1
- data/CHANGELOG.md +8 -0
- data/README.md +24 -0
- data/Rakefile +3 -3
- data/lib/mongoid/history.rb +12 -1
- data/lib/mongoid/history/mongoid.rb +1 -1
- data/lib/mongoid/history/trackable.rb +24 -10
- data/lib/mongoid/history/tracker.rb +8 -8
- data/lib/mongoid/history/version.rb +1 -1
- data/mongoid-history.gemspec +2 -2
- data/spec/integration/embedded_in_polymorphic_spec.rb +4 -4
- data/spec/integration/integration_spec.rb +391 -389
- data/spec/integration/multi_relation_spec.rb +11 -11
- data/spec/integration/nested_embedded_documents_spec.rb +7 -7
- data/spec/integration/nested_embedded_polymorphic_documents_spec.rb +127 -0
- data/spec/integration/subclasses_spec.rb +4 -4
- data/spec/spec_helper.rb +2 -1
- data/spec/support/mongoid_history.rb +2 -2
- data/spec/unit/trackable_spec.rb +84 -84
- data/spec/unit/tracker_spec.rb +2 -2
- metadata +36 -34
- data/lib/mongoid-history.rb +0 -11
data/spec/unit/tracker_spec.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Mongoid::History::Tracker do
|
4
|
-
it
|
4
|
+
it 'should set tracker_class_name when included' do
|
5
5
|
class MyTracker
|
6
6
|
include Mongoid::History::Tracker
|
7
7
|
end
|
8
|
-
Mongoid::History.tracker_class_name.
|
8
|
+
expect(Mongoid::History.tracker_class_name).to eq(:my_tracker)
|
9
9
|
end
|
10
10
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongoid-history
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Qian
|
@@ -10,90 +10,90 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2015-02-09 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: easy_diff
|
17
17
|
requirement: !ruby/object:Gem::Requirement
|
18
18
|
requirements:
|
19
|
-
- -
|
19
|
+
- - '>='
|
20
20
|
- !ruby/object:Gem::Version
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
|
-
- -
|
26
|
+
- - '>='
|
27
27
|
- !ruby/object:Gem::Version
|
28
28
|
version: '0'
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: mongoid
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
32
32
|
requirements:
|
33
|
-
- -
|
33
|
+
- - '>='
|
34
34
|
- !ruby/object:Gem::Version
|
35
35
|
version: '3.0'
|
36
36
|
type: :runtime
|
37
37
|
prerelease: false
|
38
38
|
version_requirements: !ruby/object:Gem::Requirement
|
39
39
|
requirements:
|
40
|
-
- -
|
40
|
+
- - '>='
|
41
41
|
- !ruby/object:Gem::Version
|
42
42
|
version: '3.0'
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: activesupport
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
|
-
- -
|
47
|
+
- - '>='
|
48
48
|
- !ruby/object:Gem::Version
|
49
49
|
version: '0'
|
50
50
|
type: :runtime
|
51
51
|
prerelease: false
|
52
52
|
version_requirements: !ruby/object:Gem::Requirement
|
53
53
|
requirements:
|
54
|
-
- -
|
54
|
+
- - '>='
|
55
55
|
- !ruby/object:Gem::Version
|
56
56
|
version: '0'
|
57
57
|
- !ruby/object:Gem::Dependency
|
58
58
|
name: rake
|
59
59
|
requirement: !ruby/object:Gem::Requirement
|
60
60
|
requirements:
|
61
|
-
- -
|
61
|
+
- - '>='
|
62
62
|
- !ruby/object:Gem::Version
|
63
63
|
version: '0'
|
64
64
|
type: :development
|
65
65
|
prerelease: false
|
66
66
|
version_requirements: !ruby/object:Gem::Requirement
|
67
67
|
requirements:
|
68
|
-
- -
|
68
|
+
- - '>='
|
69
69
|
- !ruby/object:Gem::Version
|
70
70
|
version: '0'
|
71
71
|
- !ruby/object:Gem::Dependency
|
72
72
|
name: rspec
|
73
73
|
requirement: !ruby/object:Gem::Requirement
|
74
74
|
requirements:
|
75
|
-
- -
|
75
|
+
- - ~>
|
76
76
|
- !ruby/object:Gem::Version
|
77
|
-
version: '3.
|
77
|
+
version: '3.1'
|
78
78
|
type: :development
|
79
79
|
prerelease: false
|
80
80
|
version_requirements: !ruby/object:Gem::Requirement
|
81
81
|
requirements:
|
82
|
-
- -
|
82
|
+
- - ~>
|
83
83
|
- !ruby/object:Gem::Version
|
84
|
-
version: '3.
|
84
|
+
version: '3.1'
|
85
85
|
- !ruby/object:Gem::Dependency
|
86
86
|
name: bundler
|
87
87
|
requirement: !ruby/object:Gem::Requirement
|
88
88
|
requirements:
|
89
|
-
- -
|
89
|
+
- - '>='
|
90
90
|
- !ruby/object:Gem::Version
|
91
91
|
version: '0'
|
92
92
|
type: :development
|
93
93
|
prerelease: false
|
94
94
|
version_requirements: !ruby/object:Gem::Requirement
|
95
95
|
requirements:
|
96
|
-
- -
|
96
|
+
- - '>='
|
97
97
|
- !ruby/object:Gem::Version
|
98
98
|
version: '0'
|
99
99
|
- !ruby/object:Gem::Dependency
|
@@ -102,54 +102,54 @@ dependencies:
|
|
102
102
|
requirements:
|
103
103
|
- - '='
|
104
104
|
- !ruby/object:Gem::Version
|
105
|
-
version: 0.
|
105
|
+
version: 0.27.1
|
106
106
|
type: :development
|
107
107
|
prerelease: false
|
108
108
|
version_requirements: !ruby/object:Gem::Requirement
|
109
109
|
requirements:
|
110
110
|
- - '='
|
111
111
|
- !ruby/object:Gem::Version
|
112
|
-
version: 0.
|
112
|
+
version: 0.27.1
|
113
113
|
- !ruby/object:Gem::Dependency
|
114
114
|
name: yard
|
115
115
|
requirement: !ruby/object:Gem::Requirement
|
116
116
|
requirements:
|
117
|
-
- -
|
117
|
+
- - '>='
|
118
118
|
- !ruby/object:Gem::Version
|
119
119
|
version: '0'
|
120
120
|
type: :development
|
121
121
|
prerelease: false
|
122
122
|
version_requirements: !ruby/object:Gem::Requirement
|
123
123
|
requirements:
|
124
|
-
- -
|
124
|
+
- - '>='
|
125
125
|
- !ruby/object:Gem::Version
|
126
126
|
version: '0'
|
127
127
|
- !ruby/object:Gem::Dependency
|
128
128
|
name: gem-release
|
129
129
|
requirement: !ruby/object:Gem::Requirement
|
130
130
|
requirements:
|
131
|
-
- -
|
131
|
+
- - '>='
|
132
132
|
- !ruby/object:Gem::Version
|
133
133
|
version: '0'
|
134
134
|
type: :development
|
135
135
|
prerelease: false
|
136
136
|
version_requirements: !ruby/object:Gem::Requirement
|
137
137
|
requirements:
|
138
|
-
- -
|
138
|
+
- - '>='
|
139
139
|
- !ruby/object:Gem::Version
|
140
140
|
version: '0'
|
141
141
|
- !ruby/object:Gem::Dependency
|
142
142
|
name: coveralls
|
143
143
|
requirement: !ruby/object:Gem::Requirement
|
144
144
|
requirements:
|
145
|
-
- -
|
145
|
+
- - '>='
|
146
146
|
- !ruby/object:Gem::Version
|
147
147
|
version: '0'
|
148
148
|
type: :development
|
149
149
|
prerelease: false
|
150
150
|
version_requirements: !ruby/object:Gem::Requirement
|
151
151
|
requirements:
|
152
|
-
- -
|
152
|
+
- - '>='
|
153
153
|
- !ruby/object:Gem::Version
|
154
154
|
version: '0'
|
155
155
|
description: This library tracks historical changes for any document, including embedded
|
@@ -169,19 +169,19 @@ executables: []
|
|
169
169
|
extensions: []
|
170
170
|
extra_rdoc_files: []
|
171
171
|
files:
|
172
|
-
-
|
173
|
-
-
|
174
|
-
-
|
175
|
-
-
|
176
|
-
-
|
177
|
-
-
|
172
|
+
- .coveralls.yml
|
173
|
+
- .document
|
174
|
+
- .gitignore
|
175
|
+
- .rspec
|
176
|
+
- .rubocop.yml
|
177
|
+
- .rubocop_todo.yml
|
178
|
+
- .travis.yml
|
178
179
|
- CHANGELOG.md
|
179
180
|
- CONTRIBUTING.md
|
180
181
|
- Gemfile
|
181
182
|
- LICENSE.txt
|
182
183
|
- README.md
|
183
184
|
- Rakefile
|
184
|
-
- lib/mongoid-history.rb
|
185
185
|
- lib/mongoid/history.rb
|
186
186
|
- lib/mongoid/history/mongoid.rb
|
187
187
|
- lib/mongoid/history/trackable.rb
|
@@ -192,6 +192,7 @@ files:
|
|
192
192
|
- spec/integration/integration_spec.rb
|
193
193
|
- spec/integration/multi_relation_spec.rb
|
194
194
|
- spec/integration/nested_embedded_documents_spec.rb
|
195
|
+
- spec/integration/nested_embedded_polymorphic_documents_spec.rb
|
195
196
|
- spec/integration/subclasses_spec.rb
|
196
197
|
- spec/spec_helper.rb
|
197
198
|
- spec/support/mongoid.rb
|
@@ -208,17 +209,17 @@ require_paths:
|
|
208
209
|
- lib
|
209
210
|
required_ruby_version: !ruby/object:Gem::Requirement
|
210
211
|
requirements:
|
211
|
-
- -
|
212
|
+
- - '>='
|
212
213
|
- !ruby/object:Gem::Version
|
213
214
|
version: '0'
|
214
215
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
215
216
|
requirements:
|
216
|
-
- -
|
217
|
+
- - '>='
|
217
218
|
- !ruby/object:Gem::Version
|
218
219
|
version: '0'
|
219
220
|
requirements: []
|
220
221
|
rubyforge_project:
|
221
|
-
rubygems_version: 2.
|
222
|
+
rubygems_version: 2.4.5
|
222
223
|
signing_key:
|
223
224
|
specification_version: 4
|
224
225
|
summary: Track and audit, undo and redo changes on Mongoid documents.
|
@@ -227,6 +228,7 @@ test_files:
|
|
227
228
|
- spec/integration/integration_spec.rb
|
228
229
|
- spec/integration/multi_relation_spec.rb
|
229
230
|
- spec/integration/nested_embedded_documents_spec.rb
|
231
|
+
- spec/integration/nested_embedded_polymorphic_documents_spec.rb
|
230
232
|
- spec/integration/subclasses_spec.rb
|
231
233
|
- spec/spec_helper.rb
|
232
234
|
- spec/support/mongoid.rb
|
data/lib/mongoid-history.rb
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
require 'easy_diff'
|
2
|
-
|
3
|
-
require 'mongoid/history'
|
4
|
-
require 'mongoid/history/version'
|
5
|
-
require 'mongoid/history/mongoid'
|
6
|
-
require 'mongoid/history/tracker'
|
7
|
-
require 'mongoid/history/trackable'
|
8
|
-
|
9
|
-
Mongoid::History.modifier_class_name = "User"
|
10
|
-
Mongoid::History.trackable_class_options = {}
|
11
|
-
Mongoid::History.current_user_method ||= :current_user
|