mongoid-history 0.8.3 → 0.8.5
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/.coveralls.yml +1 -1
- data/.document +5 -5
- data/.github/workflows/test.yml +72 -0
- data/.gitignore +46 -46
- data/.rspec +2 -2
- data/.rubocop.yml +6 -6
- data/.rubocop_todo.yml +99 -99
- data/CHANGELOG.md +173 -163
- data/CONTRIBUTING.md +117 -118
- data/Dangerfile +1 -1
- data/Gemfile +49 -40
- data/LICENSE.txt +20 -20
- data/README.md +609 -608
- data/RELEASING.md +66 -67
- data/Rakefile +24 -24
- data/UPGRADING.md +53 -53
- data/lib/mongoid/history/attributes/base.rb +72 -72
- data/lib/mongoid/history/attributes/create.rb +45 -45
- data/lib/mongoid/history/attributes/destroy.rb +34 -34
- data/lib/mongoid/history/attributes/update.rb +104 -104
- data/lib/mongoid/history/options.rb +177 -177
- data/lib/mongoid/history/trackable.rb +588 -583
- data/lib/mongoid/history/tracker.rb +247 -247
- data/lib/mongoid/history/version.rb +5 -5
- data/lib/mongoid/history.rb +77 -77
- data/lib/mongoid-history.rb +1 -1
- data/mongoid-history.gemspec +25 -25
- data/perf/benchmark_modified_attributes_for_create.rb +65 -65
- data/perf/gc_suite.rb +21 -21
- data/spec/integration/embedded_in_polymorphic_spec.rb +112 -112
- data/spec/integration/integration_spec.rb +976 -976
- data/spec/integration/multi_relation_spec.rb +47 -47
- data/spec/integration/multiple_trackers_spec.rb +68 -68
- data/spec/integration/nested_embedded_documents_spec.rb +64 -64
- data/spec/integration/nested_embedded_documents_tracked_in_parent_spec.rb +124 -124
- data/spec/integration/nested_embedded_polymorphic_documents_spec.rb +115 -115
- data/spec/integration/subclasses_spec.rb +47 -47
- data/spec/integration/track_history_order_spec.rb +84 -84
- data/spec/integration/validation_failure_spec.rb +76 -76
- data/spec/spec_helper.rb +32 -30
- data/spec/support/error_helpers.rb +7 -0
- data/spec/support/mongoid.rb +11 -11
- data/spec/support/mongoid_history.rb +12 -12
- data/spec/unit/attributes/base_spec.rb +141 -141
- data/spec/unit/attributes/create_spec.rb +342 -342
- data/spec/unit/attributes/destroy_spec.rb +228 -228
- data/spec/unit/attributes/update_spec.rb +342 -342
- data/spec/unit/callback_options_spec.rb +165 -165
- data/spec/unit/embedded_methods_spec.rb +87 -87
- data/spec/unit/history_spec.rb +58 -58
- data/spec/unit/my_instance_methods_spec.rb +555 -555
- data/spec/unit/options_spec.rb +365 -365
- data/spec/unit/singleton_methods_spec.rb +406 -406
- data/spec/unit/store/default_store_spec.rb +11 -11
- data/spec/unit/store/request_store_spec.rb +13 -13
- data/spec/unit/trackable_spec.rb +1057 -987
- data/spec/unit/tracker_spec.rb +190 -190
- metadata +9 -7
- data/.travis.yml +0 -36
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b67b16c71da971d65e59f55d4cca0a8200adef185bb57bb21392d7f18bc0d510
|
4
|
+
data.tar.gz: 111c75120df8aae5b5fb70b2a9e15df04d85aa8c469dca1798cc2b3679065d0a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 17aeb35a1db7f39b3bf888d837f09f2390f77f5713df0a3c3027b7689631f9cac13f671d111ab95a476161348c1fd18494de6acc461d48339c4001d747e24a15
|
7
|
+
data.tar.gz: 7bd7e59b6c37dbf4d9fa1c559a35a1afe1ca59feb2048413e89f85353493fe7e431fb57a4d9b595d1eb6ab70f78e4544f528edf90aace350426c327c1568bc54
|
data/.coveralls.yml
CHANGED
@@ -1 +1 @@
|
|
1
|
-
service_name: travis-ci
|
1
|
+
service_name: travis-ci
|
data/.document
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
lib/**/*.rb
|
2
|
-
bin/*
|
3
|
-
-
|
4
|
-
features/**/*.feature
|
5
|
-
LICENSE.txt
|
1
|
+
lib/**/*.rb
|
2
|
+
bin/*
|
3
|
+
-
|
4
|
+
features/**/*.feature
|
5
|
+
LICENSE.txt
|
@@ -0,0 +1,72 @@
|
|
1
|
+
name: CI RSpec Test
|
2
|
+
|
3
|
+
on: [push, pull_request]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
build:
|
7
|
+
name: >-
|
8
|
+
${{ matrix.ruby }}
|
9
|
+
env:
|
10
|
+
CI: true
|
11
|
+
TESTOPTS: -v
|
12
|
+
runs-on: ubuntu-latest
|
13
|
+
continue-on-error: ${{ matrix.experimental }}
|
14
|
+
strategy:
|
15
|
+
fail-fast: true
|
16
|
+
matrix:
|
17
|
+
ruby: [2.5, 2.6, 2.7, 3.0, jruby] # truffleruby
|
18
|
+
mongoid: [7]
|
19
|
+
experimental: [false]
|
20
|
+
include:
|
21
|
+
- ruby: 2.3
|
22
|
+
mongoid: 3
|
23
|
+
experimental: false
|
24
|
+
- ruby: 2.4
|
25
|
+
mongoid: 4
|
26
|
+
experimental: false
|
27
|
+
- ruby: 2.5
|
28
|
+
mongoid: 5
|
29
|
+
experimental: false
|
30
|
+
- ruby: 2.6
|
31
|
+
mongoid: 6
|
32
|
+
experimental: false
|
33
|
+
- ruby: 2.7
|
34
|
+
mongoid: 7.0
|
35
|
+
experimental: false
|
36
|
+
- ruby: 2.7
|
37
|
+
mongoid: 7.1
|
38
|
+
experimental: false
|
39
|
+
- ruby: 2.7
|
40
|
+
mongoid: 7.2
|
41
|
+
experimental: false
|
42
|
+
- ruby: 2.7
|
43
|
+
mongoid: 7.3
|
44
|
+
experimental: false
|
45
|
+
- ruby: head
|
46
|
+
mongoid: 7
|
47
|
+
experimental: true
|
48
|
+
- ruby: jruby-head
|
49
|
+
mongoid: 7
|
50
|
+
experimental: true
|
51
|
+
# - ruby: truffleruby-head
|
52
|
+
# mongoid: 7
|
53
|
+
# experimental: true
|
54
|
+
steps:
|
55
|
+
- name: repo checkout
|
56
|
+
uses: actions/checkout@v2
|
57
|
+
- name: start mongodb
|
58
|
+
uses: supercharge/mongodb-github-action@1.6.0
|
59
|
+
with:
|
60
|
+
mongodb-version: 4.4
|
61
|
+
mongodb-replica-set: rs0
|
62
|
+
- name: load ruby
|
63
|
+
uses: ruby/setup-ruby@v1
|
64
|
+
with:
|
65
|
+
ruby-version: ${{ matrix.ruby }}
|
66
|
+
bundler: 2
|
67
|
+
- name: bundle install
|
68
|
+
run: bundle install --jobs 4 --retry 3
|
69
|
+
- name: test
|
70
|
+
timeout-minutes: 10
|
71
|
+
run: bundle exec rake spec
|
72
|
+
continue-on-error: ${{ matrix.experimental }}
|
data/.gitignore
CHANGED
@@ -1,46 +1,46 @@
|
|
1
|
-
Gemfile.lock
|
2
|
-
|
3
|
-
.rvmrc
|
4
|
-
|
5
|
-
# rcov generated
|
6
|
-
coverage
|
7
|
-
|
8
|
-
# rdoc generated
|
9
|
-
rdoc
|
10
|
-
|
11
|
-
# yard generated
|
12
|
-
doc
|
13
|
-
.yardoc
|
14
|
-
|
15
|
-
# bundler
|
16
|
-
.bundle
|
17
|
-
|
18
|
-
# jeweler generated
|
19
|
-
pkg
|
20
|
-
|
21
|
-
# Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore:
|
22
|
-
#
|
23
|
-
# * Create a file at ~/.gitignore
|
24
|
-
# * Include files you want ignored
|
25
|
-
# * Run: git config --global core.excludesfile ~/.gitignore
|
26
|
-
#
|
27
|
-
# After doing this, these files will be ignored in all your git projects,
|
28
|
-
# saving you from having to 'pollute' every project you touch with them
|
29
|
-
#
|
30
|
-
# Not sure what to needs to be ignored for particular editors/OSes? Here's some ideas to get you started. (Remember, remove the leading # of the line)
|
31
|
-
#
|
32
|
-
# For MacOS:
|
33
|
-
#
|
34
|
-
#.DS_Store
|
35
|
-
#
|
36
|
-
# For TextMate
|
37
|
-
#*.tmproj
|
38
|
-
#tmtags
|
39
|
-
#
|
40
|
-
# For emacs:
|
41
|
-
#*~
|
42
|
-
#\#*
|
43
|
-
#.\#*
|
44
|
-
#
|
45
|
-
# For vim:
|
46
|
-
#*.swp
|
1
|
+
Gemfile.lock
|
2
|
+
|
3
|
+
.rvmrc
|
4
|
+
|
5
|
+
# rcov generated
|
6
|
+
coverage
|
7
|
+
|
8
|
+
# rdoc generated
|
9
|
+
rdoc
|
10
|
+
|
11
|
+
# yard generated
|
12
|
+
doc
|
13
|
+
.yardoc
|
14
|
+
|
15
|
+
# bundler
|
16
|
+
.bundle
|
17
|
+
|
18
|
+
# jeweler generated
|
19
|
+
pkg
|
20
|
+
|
21
|
+
# Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore:
|
22
|
+
#
|
23
|
+
# * Create a file at ~/.gitignore
|
24
|
+
# * Include files you want ignored
|
25
|
+
# * Run: git config --global core.excludesfile ~/.gitignore
|
26
|
+
#
|
27
|
+
# After doing this, these files will be ignored in all your git projects,
|
28
|
+
# saving you from having to 'pollute' every project you touch with them
|
29
|
+
#
|
30
|
+
# Not sure what to needs to be ignored for particular editors/OSes? Here's some ideas to get you started. (Remember, remove the leading # of the line)
|
31
|
+
#
|
32
|
+
# For MacOS:
|
33
|
+
#
|
34
|
+
#.DS_Store
|
35
|
+
#
|
36
|
+
# For TextMate
|
37
|
+
#*.tmproj
|
38
|
+
#tmtags
|
39
|
+
#
|
40
|
+
# For emacs:
|
41
|
+
#*~
|
42
|
+
#\#*
|
43
|
+
#.\#*
|
44
|
+
#
|
45
|
+
# For vim:
|
46
|
+
#*.swp
|
data/.rspec
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
--color
|
2
|
-
--format=documentation
|
1
|
+
--color
|
2
|
+
--format=documentation
|
data/.rubocop.yml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
AllCops:
|
2
|
-
Exclude:
|
3
|
-
- vendor/**/*
|
4
|
-
- bin/**/*
|
5
|
-
|
6
|
-
inherit_from: .rubocop_todo.yml
|
1
|
+
AllCops:
|
2
|
+
Exclude:
|
3
|
+
- vendor/**/*
|
4
|
+
- bin/**/*
|
5
|
+
|
6
|
+
inherit_from: .rubocop_todo.yml
|
data/.rubocop_todo.yml
CHANGED
@@ -1,99 +1,99 @@
|
|
1
|
-
# This configuration was generated by
|
2
|
-
# `rubocop --auto-gen-config`
|
3
|
-
# on 2020-04-10 17:25:32 -0500 using RuboCop version 0.48.1.
|
4
|
-
# The point is for the user to remove these configuration records
|
5
|
-
# one by one as the offenses are removed from the code base.
|
6
|
-
# Note that changes in the inspected code, or installation of new
|
7
|
-
# versions of RuboCop, may require this file to be generated again.
|
8
|
-
|
9
|
-
# Offense count: 7
|
10
|
-
# Configuration parameters: Include.
|
11
|
-
# Include: **/Gemfile, **/gems.rb
|
12
|
-
Bundler/DuplicatedGem:
|
13
|
-
Exclude:
|
14
|
-
- 'Gemfile'
|
15
|
-
|
16
|
-
# Offense count: 3
|
17
|
-
Lint/HandleExceptions:
|
18
|
-
Exclude:
|
19
|
-
- 'spec/unit/trackable_spec.rb'
|
20
|
-
|
21
|
-
# Offense count: 3
|
22
|
-
Lint/ParenthesesAsGroupedExpression:
|
23
|
-
Exclude:
|
24
|
-
- 'spec/integration/integration_spec.rb'
|
25
|
-
- 'spec/integration/nested_embedded_polymorphic_documents_spec.rb'
|
26
|
-
|
27
|
-
# Offense count: 22
|
28
|
-
Metrics/AbcSize:
|
29
|
-
Max: 52
|
30
|
-
|
31
|
-
# Offense count: 122
|
32
|
-
# Configuration parameters: CountComments, ExcludedMethods.
|
33
|
-
Metrics/BlockLength:
|
34
|
-
Max:
|
35
|
-
|
36
|
-
# Offense count: 1
|
37
|
-
# Configuration parameters: CountComments.
|
38
|
-
Metrics/ClassLength:
|
39
|
-
Max: 120
|
40
|
-
|
41
|
-
# Offense count: 6
|
42
|
-
Metrics/CyclomaticComplexity:
|
43
|
-
Max: 13
|
44
|
-
|
45
|
-
# Offense count: 412
|
46
|
-
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
|
47
|
-
# URISchemes: http, https
|
48
|
-
Metrics/LineLength:
|
49
|
-
Max: 688
|
50
|
-
|
51
|
-
# Offense count: 17
|
52
|
-
# Configuration parameters: CountComments.
|
53
|
-
Metrics/MethodLength:
|
54
|
-
Max: 23
|
55
|
-
|
56
|
-
# Offense count: 2
|
57
|
-
# Configuration parameters: CountComments.
|
58
|
-
Metrics/ModuleLength:
|
59
|
-
Max:
|
60
|
-
|
61
|
-
# Offense count: 6
|
62
|
-
Metrics/PerceivedComplexity:
|
63
|
-
Max: 15
|
64
|
-
|
65
|
-
# Offense count: 15
|
66
|
-
Style/Documentation:
|
67
|
-
Exclude:
|
68
|
-
- 'spec/**/*'
|
69
|
-
- 'test/**/*'
|
70
|
-
- 'lib/mongoid/history.rb'
|
71
|
-
- 'lib/mongoid/history/attributes/base.rb'
|
72
|
-
- 'lib/mongoid/history/attributes/create.rb'
|
73
|
-
- 'lib/mongoid/history/attributes/destroy.rb'
|
74
|
-
- 'lib/mongoid/history/attributes/update.rb'
|
75
|
-
- 'lib/mongoid/history/options.rb'
|
76
|
-
- 'lib/mongoid/history/trackable.rb'
|
77
|
-
- 'lib/mongoid/history/tracker.rb'
|
78
|
-
- 'perf/benchmark_modified_attributes_for_create.rb'
|
79
|
-
- 'perf/gc_suite.rb'
|
80
|
-
|
81
|
-
# Offense count: 3
|
82
|
-
# Cop supports --auto-correct.
|
83
|
-
Style/EachWithObject:
|
84
|
-
Exclude:
|
85
|
-
- 'lib/mongoid/history/trackable.rb'
|
86
|
-
- 'lib/mongoid/history/tracker.rb'
|
87
|
-
|
88
|
-
# Offense count: 2
|
89
|
-
# Configuration parameters: ExpectMatchingDefinition, Regex, IgnoreExecutableScripts, AllowedAcronyms.
|
90
|
-
# AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS
|
91
|
-
Style/FileName:
|
92
|
-
Exclude:
|
93
|
-
- 'Dangerfile'
|
94
|
-
- 'lib/mongoid-history.rb'
|
95
|
-
|
96
|
-
# Offense count: 1
|
97
|
-
Style/MultilineBlockChain:
|
98
|
-
Exclude:
|
99
|
-
- 'lib/mongoid/history/tracker.rb'
|
1
|
+
# This configuration was generated by
|
2
|
+
# `rubocop --auto-gen-config`
|
3
|
+
# on 2020-04-10 17:25:32 -0500 using RuboCop version 0.48.1.
|
4
|
+
# The point is for the user to remove these configuration records
|
5
|
+
# one by one as the offenses are removed from the code base.
|
6
|
+
# Note that changes in the inspected code, or installation of new
|
7
|
+
# versions of RuboCop, may require this file to be generated again.
|
8
|
+
|
9
|
+
# Offense count: 7
|
10
|
+
# Configuration parameters: Include.
|
11
|
+
# Include: **/Gemfile, **/gems.rb
|
12
|
+
Bundler/DuplicatedGem:
|
13
|
+
Exclude:
|
14
|
+
- 'Gemfile'
|
15
|
+
|
16
|
+
# Offense count: 3
|
17
|
+
Lint/HandleExceptions:
|
18
|
+
Exclude:
|
19
|
+
- 'spec/unit/trackable_spec.rb'
|
20
|
+
|
21
|
+
# Offense count: 3
|
22
|
+
Lint/ParenthesesAsGroupedExpression:
|
23
|
+
Exclude:
|
24
|
+
- 'spec/integration/integration_spec.rb'
|
25
|
+
- 'spec/integration/nested_embedded_polymorphic_documents_spec.rb'
|
26
|
+
|
27
|
+
# Offense count: 22
|
28
|
+
Metrics/AbcSize:
|
29
|
+
Max: 52
|
30
|
+
|
31
|
+
# Offense count: 122
|
32
|
+
# Configuration parameters: CountComments, ExcludedMethods.
|
33
|
+
Metrics/BlockLength:
|
34
|
+
Max: 900
|
35
|
+
|
36
|
+
# Offense count: 1
|
37
|
+
# Configuration parameters: CountComments.
|
38
|
+
Metrics/ClassLength:
|
39
|
+
Max: 120
|
40
|
+
|
41
|
+
# Offense count: 6
|
42
|
+
Metrics/CyclomaticComplexity:
|
43
|
+
Max: 13
|
44
|
+
|
45
|
+
# Offense count: 412
|
46
|
+
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
|
47
|
+
# URISchemes: http, https
|
48
|
+
Metrics/LineLength:
|
49
|
+
Max: 688
|
50
|
+
|
51
|
+
# Offense count: 17
|
52
|
+
# Configuration parameters: CountComments.
|
53
|
+
Metrics/MethodLength:
|
54
|
+
Max: 23
|
55
|
+
|
56
|
+
# Offense count: 2
|
57
|
+
# Configuration parameters: CountComments.
|
58
|
+
Metrics/ModuleLength:
|
59
|
+
Max: 200
|
60
|
+
|
61
|
+
# Offense count: 6
|
62
|
+
Metrics/PerceivedComplexity:
|
63
|
+
Max: 15
|
64
|
+
|
65
|
+
# Offense count: 15
|
66
|
+
Style/Documentation:
|
67
|
+
Exclude:
|
68
|
+
- 'spec/**/*'
|
69
|
+
- 'test/**/*'
|
70
|
+
- 'lib/mongoid/history.rb'
|
71
|
+
- 'lib/mongoid/history/attributes/base.rb'
|
72
|
+
- 'lib/mongoid/history/attributes/create.rb'
|
73
|
+
- 'lib/mongoid/history/attributes/destroy.rb'
|
74
|
+
- 'lib/mongoid/history/attributes/update.rb'
|
75
|
+
- 'lib/mongoid/history/options.rb'
|
76
|
+
- 'lib/mongoid/history/trackable.rb'
|
77
|
+
- 'lib/mongoid/history/tracker.rb'
|
78
|
+
- 'perf/benchmark_modified_attributes_for_create.rb'
|
79
|
+
- 'perf/gc_suite.rb'
|
80
|
+
|
81
|
+
# Offense count: 3
|
82
|
+
# Cop supports --auto-correct.
|
83
|
+
Style/EachWithObject:
|
84
|
+
Exclude:
|
85
|
+
- 'lib/mongoid/history/trackable.rb'
|
86
|
+
- 'lib/mongoid/history/tracker.rb'
|
87
|
+
|
88
|
+
# Offense count: 2
|
89
|
+
# Configuration parameters: ExpectMatchingDefinition, Regex, IgnoreExecutableScripts, AllowedAcronyms.
|
90
|
+
# AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS
|
91
|
+
Style/FileName:
|
92
|
+
Exclude:
|
93
|
+
- 'Dangerfile'
|
94
|
+
- 'lib/mongoid-history.rb'
|
95
|
+
|
96
|
+
# Offense count: 1
|
97
|
+
Style/MultilineBlockChain:
|
98
|
+
Exclude:
|
99
|
+
- 'lib/mongoid/history/tracker.rb'
|