mongoid-cached-json 1.5.3 → 1.7.0
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 +5 -5
- data/.github/workflows/danger-comment.yml +11 -0
- data/.github/workflows/danger.yml +13 -0
- data/.github/workflows/test.yml +67 -0
- data/.gitignore +1 -0
- data/.rubocop.yml +1 -0
- data/.rubocop_todo.yml +258 -28
- data/CHANGELOG.md +64 -57
- data/CONTRIBUTING.md +6 -4
- data/Dangerfile +5 -0
- data/Gemfile +14 -14
- data/README.md +96 -12
- data/Rakefile +1 -1
- data/UPGRADING.md +59 -0
- data/lib/mongoid-cached-json/cached_json.rb +68 -17
- data/lib/mongoid-cached-json/config.rb +0 -1
- data/lib/mongoid-cached-json/version.rb +1 -1
- data/mongoid-cached-json.gemspec +2 -2
- data/spec/all_fields_spec.rb +47 -0
- data/spec/cache_version_spec.rb +58 -0
- data/spec/cached_json_spec.rb +26 -17
- data/spec/dalli_spec.rb +3 -4
- data/spec/field_cache_spec.rb +73 -0
- data/spec/model_cache_spec.rb +64 -0
- data/spec/mongoid_criteria_spec.rb +2 -1
- data/spec/spec_helper.rb +22 -0
- data/spec/support/fast_json_image.rb +5 -1
- data/spec/support/json_employee.rb +1 -0
- data/spec/support/json_manager.rb +12 -2
- data/spec/support/tool.rb +6 -1
- metadata +17 -11
- data/.travis.yml +0 -17
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 2eb956338cff6d5c5c259e29fc0307bab7023184518eb6b92c54250cdbf685b3
|
|
4
|
+
data.tar.gz: 8da71923ba0bbaca5e039792c62e1b7c100233ce620c4d2b32ce224ddd72d77e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f51ccb56969c000cfec8743fa58e9843246f505201e8c81b67d43afb728b1d1ff82c4b25413e8cae7bd537531bdf06edfa654668d74d070cfeebd86d3f95495e
|
|
7
|
+
data.tar.gz: b8cd64ebaa2757275b4b33c8d6f1b5f077548c04c9bd3c700d33bf0802b9cb6bc4f7ff15977d10f16c653bbec93db78cfa4c307f481f71e49627dab08cc4476e
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
name: Test
|
|
2
|
+
|
|
3
|
+
on: [push, pull_request]
|
|
4
|
+
|
|
5
|
+
permissions:
|
|
6
|
+
contents: read
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
test:
|
|
10
|
+
name: Ruby ${{ matrix.ruby }} / Mongoid ${{ matrix.mongoid }} / MongoDB ${{ matrix.mongodb }}
|
|
11
|
+
runs-on: ubuntu-22.04
|
|
12
|
+
timeout-minutes: 15
|
|
13
|
+
strategy:
|
|
14
|
+
fail-fast: false
|
|
15
|
+
matrix:
|
|
16
|
+
include:
|
|
17
|
+
- { ruby: '2.1.9', mongoid: '3', mongodb: '3.6', bundler: '1.17.3' }
|
|
18
|
+
- { ruby: '2.3.8', mongoid: '4', mongodb: '3.6', bundler: '2.3.26' }
|
|
19
|
+
- { ruby: '2.3.8', mongoid: '5', mongodb: '4.0', bundler: '2.3.26' }
|
|
20
|
+
- { ruby: '2.5.9', mongoid: '6', mongodb: '4.0', bundler: '2.3.26' }
|
|
21
|
+
- { ruby: '2.7.8', mongoid: '7', mongodb: '4.4', bundler: '2.4.22' }
|
|
22
|
+
- { ruby: '3.2', mongoid: '8', mongodb: '6.0', bundler: default }
|
|
23
|
+
- { ruby: '3.3', mongoid: '9', mongodb: '7.0', bundler: default }
|
|
24
|
+
- { ruby: '3.4', mongoid: '9', mongodb: '8.0', bundler: default }
|
|
25
|
+
- { ruby: '4.0', mongoid: '9', mongodb: '8.0', bundler: default }
|
|
26
|
+
env:
|
|
27
|
+
MONGOID_VERSION: ${{ matrix.mongoid }}
|
|
28
|
+
COVERAGE: ${{ matrix.ruby == '4.0' && 'true' || 'false' }}
|
|
29
|
+
services:
|
|
30
|
+
mongodb:
|
|
31
|
+
image: mongo:${{ matrix.mongodb }}
|
|
32
|
+
ports: ['27017:27017']
|
|
33
|
+
options: >-
|
|
34
|
+
--health-cmd "bash -c 'echo > /dev/tcp/127.0.0.1/27017'"
|
|
35
|
+
--health-interval 5s --health-timeout 5s --health-retries 20
|
|
36
|
+
memcached:
|
|
37
|
+
image: memcached:1.6
|
|
38
|
+
ports: ['11211:11211']
|
|
39
|
+
steps:
|
|
40
|
+
- uses: actions/checkout@v6
|
|
41
|
+
- uses: ruby/setup-ruby@v1
|
|
42
|
+
with:
|
|
43
|
+
ruby-version: ${{ matrix.ruby }}
|
|
44
|
+
bundler: ${{ matrix.bundler }}
|
|
45
|
+
bundler-cache: true
|
|
46
|
+
- run: bundle exec rake spec
|
|
47
|
+
- name: Report coverage to Coveralls
|
|
48
|
+
if: matrix.ruby == '4.0'
|
|
49
|
+
uses: coverallsapp/github-action@v2
|
|
50
|
+
with:
|
|
51
|
+
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
52
|
+
file: coverage/.resultset.json
|
|
53
|
+
format: simplecov
|
|
54
|
+
|
|
55
|
+
lint:
|
|
56
|
+
runs-on: ubuntu-22.04
|
|
57
|
+
env:
|
|
58
|
+
MONGOID_VERSION: '7'
|
|
59
|
+
RUBOCOP_VERSION: '1.92.0'
|
|
60
|
+
steps:
|
|
61
|
+
- uses: actions/checkout@v6
|
|
62
|
+
- uses: ruby/setup-ruby@v1
|
|
63
|
+
with:
|
|
64
|
+
ruby-version: '2.7.8'
|
|
65
|
+
bundler: '2.4.22'
|
|
66
|
+
bundler-cache: true
|
|
67
|
+
- run: bundle exec rake rubocop
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
data/.rubocop_todo.yml
CHANGED
|
@@ -1,81 +1,229 @@
|
|
|
1
1
|
# This configuration was generated by
|
|
2
2
|
# `rubocop --auto-gen-config`
|
|
3
|
-
# on
|
|
3
|
+
# on 2026-10-17 02:13:27 UTC using RuboCop version 1.92.0.
|
|
4
4
|
# The point is for the user to remove these configuration records
|
|
5
5
|
# one by one as the offenses are removed from the code base.
|
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
|
8
8
|
|
|
9
9
|
# Offense count: 1
|
|
10
|
+
Gemspec/RequiredRubyVersion:
|
|
11
|
+
Exclude:
|
|
12
|
+
- 'mongoid-cached-json.gemspec'
|
|
13
|
+
|
|
14
|
+
# Offense count: 4
|
|
15
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
16
|
+
Layout/EmptyLineAfterGuardClause:
|
|
17
|
+
Exclude:
|
|
18
|
+
- 'lib/mongoid-cached-json/cached_json.rb'
|
|
19
|
+
|
|
20
|
+
# Offense count: 4
|
|
21
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
22
|
+
# Configuration parameters: NumberOfEmptyLines.
|
|
23
|
+
Layout/EmptyLineAfterMagicComment:
|
|
24
|
+
Exclude:
|
|
25
|
+
- 'lib/mongoid-cached-json.rb'
|
|
26
|
+
- 'lib/mongoid-cached-json/cached_json.rb'
|
|
27
|
+
- 'lib/mongoid-cached-json/config.rb'
|
|
28
|
+
- 'lib/mongoid-cached-json/key_references.rb'
|
|
29
|
+
|
|
30
|
+
# Offense count: 16
|
|
31
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
32
|
+
# Configuration parameters: IndentationWidth.
|
|
33
|
+
# SupportedStyles: special_inside_parentheses, consistent, align_brackets
|
|
34
|
+
Layout/FirstArrayElementIndentation:
|
|
35
|
+
EnforcedStyle: consistent
|
|
36
|
+
|
|
37
|
+
# Offense count: 1
|
|
38
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
39
|
+
# Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
|
|
40
|
+
# SupportedHashRocketStyles: key, separator, table
|
|
41
|
+
# SupportedColonStyles: key, separator, table
|
|
42
|
+
# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
|
|
43
|
+
Layout/HashAlignment:
|
|
44
|
+
Exclude:
|
|
45
|
+
- 'lib/mongoid-cached-json/cached_json.rb'
|
|
46
|
+
|
|
47
|
+
# Offense count: 1
|
|
48
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
49
|
+
# Configuration parameters: EnforcedStyle.
|
|
50
|
+
# SupportedStyles: symmetrical, new_line, same_line
|
|
51
|
+
Layout/MultilineArrayBraceLayout:
|
|
52
|
+
Exclude:
|
|
53
|
+
- 'spec/cached_json_spec.rb'
|
|
54
|
+
|
|
55
|
+
# Offense count: 4
|
|
56
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
57
|
+
# Configuration parameters: EnforcedStyle.
|
|
58
|
+
# SupportedStyles: symmetrical, new_line, same_line
|
|
59
|
+
Layout/MultilineHashBraceLayout:
|
|
60
|
+
Exclude:
|
|
61
|
+
- 'spec/cached_json_spec.rb'
|
|
62
|
+
|
|
63
|
+
# Offense count: 2
|
|
64
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
65
|
+
# Configuration parameters: EnforcedStyle.
|
|
66
|
+
# SupportedStyles: symmetrical, new_line, same_line
|
|
67
|
+
Layout/MultilineMethodCallBraceLayout:
|
|
68
|
+
Exclude:
|
|
69
|
+
- 'spec/cached_json_spec.rb'
|
|
70
|
+
|
|
71
|
+
# Offense count: 1
|
|
72
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
|
10
73
|
# Configuration parameters: AllowSafeAssignment.
|
|
11
74
|
Lint/AssignmentInCondition:
|
|
12
75
|
Exclude:
|
|
13
76
|
- 'lib/mongoid-cached-json/cached_json.rb'
|
|
14
77
|
|
|
78
|
+
# Offense count: 7
|
|
79
|
+
# Configuration parameters: AllowedMethods.
|
|
80
|
+
# AllowedMethods: enums
|
|
81
|
+
Lint/ConstantDefinitionInBlock:
|
|
82
|
+
Exclude:
|
|
83
|
+
- 'spec/all_fields_spec.rb'
|
|
84
|
+
- 'spec/cache_version_spec.rb'
|
|
85
|
+
- 'spec/field_cache_spec.rb'
|
|
86
|
+
- 'spec/model_cache_spec.rb'
|
|
87
|
+
|
|
88
|
+
# Offense count: 1
|
|
89
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
|
90
|
+
Lint/NonDeterministicRequireOrder:
|
|
91
|
+
Exclude:
|
|
92
|
+
- 'spec/spec_helper.rb'
|
|
93
|
+
|
|
15
94
|
# Offense count: 1
|
|
95
|
+
# Configuration parameters: AllowKeywordBlockArguments.
|
|
16
96
|
Lint/UnderscorePrefixedVariableName:
|
|
17
97
|
Exclude:
|
|
18
98
|
- 'lib/mongoid-cached-json/cached_json.rb'
|
|
19
99
|
|
|
20
100
|
# Offense count: 2
|
|
101
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
21
102
|
Lint/UselessAssignment:
|
|
22
103
|
Exclude:
|
|
23
104
|
- 'lib/mongoid-cached-json/cached_json.rb'
|
|
24
105
|
- 'spec/cached_json_spec.rb'
|
|
25
106
|
|
|
26
|
-
# Offense count:
|
|
107
|
+
# Offense count: 7
|
|
108
|
+
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
|
|
27
109
|
Metrics/AbcSize:
|
|
28
|
-
Max:
|
|
110
|
+
Max: 79
|
|
111
|
+
|
|
112
|
+
# Offense count: 31
|
|
113
|
+
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
|
|
114
|
+
# AllowedMethods: refine
|
|
115
|
+
Metrics/BlockLength:
|
|
116
|
+
Max: 497
|
|
29
117
|
|
|
30
118
|
# Offense count: 2
|
|
119
|
+
# Configuration parameters: CountBlocks, CountModifierForms.
|
|
31
120
|
Metrics/BlockNesting:
|
|
32
121
|
Max: 4
|
|
33
122
|
|
|
34
|
-
# Offense count:
|
|
123
|
+
# Offense count: 7
|
|
124
|
+
# Configuration parameters: AllowedMethods, AllowedPatterns.
|
|
35
125
|
Metrics/CyclomaticComplexity:
|
|
36
|
-
Max:
|
|
126
|
+
Max: 21
|
|
37
127
|
|
|
38
|
-
# Offense count:
|
|
39
|
-
# Configuration parameters:
|
|
40
|
-
Metrics/LineLength:
|
|
41
|
-
Max: 202
|
|
42
|
-
|
|
43
|
-
# Offense count: 10
|
|
44
|
-
# Configuration parameters: CountComments.
|
|
128
|
+
# Offense count: 11
|
|
129
|
+
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
|
|
45
130
|
Metrics/MethodLength:
|
|
46
|
-
Max:
|
|
131
|
+
Max: 39
|
|
47
132
|
|
|
48
133
|
# Offense count: 1
|
|
49
|
-
# Configuration parameters: CountComments.
|
|
134
|
+
# Configuration parameters: CountComments, CountAsOne.
|
|
50
135
|
Metrics/ModuleLength:
|
|
51
|
-
Max:
|
|
136
|
+
Max: 154
|
|
52
137
|
|
|
53
|
-
# Offense count:
|
|
138
|
+
# Offense count: 6
|
|
139
|
+
# Configuration parameters: AllowedMethods, AllowedPatterns.
|
|
54
140
|
Metrics/PerceivedComplexity:
|
|
55
|
-
Max:
|
|
141
|
+
Max: 22
|
|
56
142
|
|
|
57
|
-
# Offense count:
|
|
143
|
+
# Offense count: 1
|
|
144
|
+
# Configuration parameters: ExpectMatchingDefinition, CheckDefinitionPathHierarchy, CheckDefinitionPathHierarchyRoots, Regex, IgnoreExecutableScripts, AllowedAcronyms.
|
|
145
|
+
# CheckDefinitionPathHierarchyRoots: lib, spec, test, src
|
|
146
|
+
# 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
|
|
147
|
+
Naming/FileName:
|
|
148
|
+
Exclude:
|
|
149
|
+
- 'Rakefile.rb'
|
|
150
|
+
- 'lib/mongoid-cached-json.rb'
|
|
151
|
+
|
|
152
|
+
# Offense count: 1
|
|
153
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
154
|
+
# Configuration parameters: EnforcedStyle.
|
|
155
|
+
# SupportedStyles: prefer_alias, prefer_alias_method
|
|
156
|
+
Style/Alias:
|
|
157
|
+
Exclude:
|
|
158
|
+
- 'lib/mongoid-cached-json/cached_json.rb'
|
|
159
|
+
|
|
160
|
+
# Offense count: 1
|
|
161
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
162
|
+
# Configuration parameters: EnforcedStyle, SingleLineConditionsOnly, IncludeTernaryExpressions.
|
|
163
|
+
# SupportedStyles: assign_to_condition, assign_inside_condition
|
|
164
|
+
Style/ConditionalAssignment:
|
|
165
|
+
Exclude:
|
|
166
|
+
- 'lib/mongoid-cached-json/cached_json.rb'
|
|
167
|
+
|
|
168
|
+
# Offense count: 7
|
|
169
|
+
# Configuration parameters: AllowedConstants.
|
|
58
170
|
Style/Documentation:
|
|
59
|
-
|
|
171
|
+
Exclude:
|
|
172
|
+
- 'spec/**/*'
|
|
173
|
+
- 'test/**/*'
|
|
174
|
+
- 'lib/mongoid-cached-json/array.rb'
|
|
175
|
+
- 'lib/mongoid-cached-json/cached_json.rb'
|
|
176
|
+
- 'lib/mongoid-cached-json/config.rb'
|
|
177
|
+
- 'lib/mongoid-cached-json/hash.rb'
|
|
178
|
+
- 'lib/mongoid-cached-json/key_references.rb'
|
|
179
|
+
- 'lib/mongoid-cached-json/mongoid_criteria.rb'
|
|
60
180
|
|
|
61
181
|
# Offense count: 2
|
|
182
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
|
183
|
+
# Configuration parameters: EnforcedStyle.
|
|
184
|
+
# SupportedStyles: allowed_in_returns, forbidden
|
|
62
185
|
Style/DoubleNegation:
|
|
63
186
|
Exclude:
|
|
64
187
|
- 'lib/mongoid-cached-json/cached_json.rb'
|
|
65
188
|
|
|
66
189
|
# Offense count: 1
|
|
190
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
67
191
|
Style/EachWithObject:
|
|
68
192
|
Exclude:
|
|
69
193
|
- 'lib/mongoid-cached-json/hash.rb'
|
|
70
194
|
|
|
71
|
-
# Offense count:
|
|
72
|
-
#
|
|
73
|
-
Style/
|
|
195
|
+
# Offense count: 3
|
|
196
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
197
|
+
Style/Encoding:
|
|
74
198
|
Exclude:
|
|
75
199
|
- 'lib/mongoid-cached-json.rb'
|
|
200
|
+
- 'lib/mongoid-cached-json/cached_json.rb'
|
|
201
|
+
- 'lib/mongoid-cached-json/config.rb'
|
|
202
|
+
|
|
203
|
+
# Offense count: 1
|
|
204
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
205
|
+
Style/EvalWithLocation:
|
|
206
|
+
Exclude:
|
|
207
|
+
- 'lib/mongoid-cached-json/config.rb'
|
|
208
|
+
|
|
209
|
+
# Offense count: 50
|
|
210
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
|
211
|
+
# Configuration parameters: EnforcedStyle.
|
|
212
|
+
# SupportedStyles: always, always_true, never
|
|
213
|
+
Style/FrozenStringLiteralComment:
|
|
214
|
+
Enabled: false
|
|
76
215
|
|
|
77
216
|
# Offense count: 5
|
|
78
|
-
#
|
|
217
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
218
|
+
Style/IfUnlessModifier:
|
|
219
|
+
Exclude:
|
|
220
|
+
- 'lib/mongoid-cached-json/cached_json.rb'
|
|
221
|
+
- 'spec/cached_json_spec.rb'
|
|
222
|
+
|
|
223
|
+
# Offense count: 5
|
|
224
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
225
|
+
# Configuration parameters: EnforcedStyle.
|
|
226
|
+
# SupportedStyles: line_count_dependent, lambda, literal
|
|
79
227
|
Style/Lambda:
|
|
80
228
|
Exclude:
|
|
81
229
|
- 'lib/mongoid-cached-json/cached_json.rb'
|
|
@@ -85,17 +233,99 @@ Style/Lambda:
|
|
|
85
233
|
- 'spec/support/sometimes_secret.rb'
|
|
86
234
|
|
|
87
235
|
# Offense count: 1
|
|
236
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
|
237
|
+
# Configuration parameters: EnforcedStyle, Autocorrect.
|
|
238
|
+
# SupportedStyles: module_function, extend_self, forbidden
|
|
88
239
|
Style/ModuleFunction:
|
|
89
240
|
Exclude:
|
|
90
241
|
- 'lib/mongoid-cached-json/config.rb'
|
|
91
242
|
|
|
92
243
|
# Offense count: 1
|
|
93
|
-
#
|
|
244
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
|
245
|
+
# Configuration parameters: EnforcedStyle, Recursive.
|
|
246
|
+
# SupportedStyles: literals, strict
|
|
247
|
+
Style/MutableConstant:
|
|
248
|
+
Exclude:
|
|
249
|
+
- 'lib/mongoid-cached-json/version.rb'
|
|
250
|
+
|
|
251
|
+
# Offense count: 1
|
|
252
|
+
# Configuration parameters: AllowedMethods.
|
|
253
|
+
# AllowedMethods: respond_to_missing?
|
|
254
|
+
Style/OptionalBooleanParameter:
|
|
255
|
+
Exclude:
|
|
256
|
+
- 'lib/mongoid-cached-json/cached_json.rb'
|
|
257
|
+
|
|
258
|
+
# Offense count: 3
|
|
259
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
260
|
+
Style/OrAssignment:
|
|
261
|
+
Exclude:
|
|
262
|
+
- 'lib/mongoid-cached-json/cached_json.rb'
|
|
263
|
+
|
|
264
|
+
# Offense count: 2
|
|
265
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
266
|
+
# Configuration parameters: PreferredDelimiters.
|
|
267
|
+
Style/PercentLiteralDelimiters:
|
|
268
|
+
Exclude:
|
|
269
|
+
- 'spec/array_spec.rb'
|
|
270
|
+
|
|
271
|
+
# Offense count: 1
|
|
272
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
|
273
|
+
# Configuration parameters: EnforcedStyle, AllowedCompactTypes.
|
|
274
|
+
# SupportedStyles: compact, exploded
|
|
94
275
|
Style/RaiseArgs:
|
|
95
|
-
|
|
276
|
+
Exclude:
|
|
277
|
+
- 'lib/mongoid-cached-json/cached_json.rb'
|
|
278
|
+
|
|
279
|
+
# Offense count: 1
|
|
280
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
|
281
|
+
Style/RedundantInterpolation:
|
|
282
|
+
Exclude:
|
|
283
|
+
- 'spec/cached_json_spec.rb'
|
|
96
284
|
|
|
97
285
|
# Offense count: 2
|
|
98
|
-
#
|
|
99
|
-
|
|
286
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
|
287
|
+
# Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength.
|
|
288
|
+
# AllowedMethods: present?, blank?, presence, try, try!
|
|
289
|
+
Style/SafeNavigation:
|
|
100
290
|
Exclude:
|
|
101
|
-
- '
|
|
291
|
+
- 'lib/mongoid-cached-json/cached_json.rb'
|
|
292
|
+
- 'lib/mongoid-cached-json/key_references.rb'
|
|
293
|
+
|
|
294
|
+
# Offense count: 2
|
|
295
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
296
|
+
# Configuration parameters: EnforcedStyle.
|
|
297
|
+
# SupportedStyles: only_raise, only_fail, semantic
|
|
298
|
+
Style/SignalException:
|
|
299
|
+
Exclude:
|
|
300
|
+
- 'lib/mongoid-cached-json/cached_json.rb'
|
|
301
|
+
- 'spec/cached_json_spec.rb'
|
|
302
|
+
|
|
303
|
+
# Offense count: 14
|
|
304
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
305
|
+
# Configuration parameters: MinSize.
|
|
306
|
+
# SupportedStyles: percent, brackets
|
|
307
|
+
Style/SymbolArray:
|
|
308
|
+
EnforcedStyle: brackets
|
|
309
|
+
|
|
310
|
+
# Offense count: 1
|
|
311
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
|
312
|
+
# Configuration parameters: AllowMethodsWithArguments, AllowedMethods, AllowedPatterns, AllowComments.
|
|
313
|
+
# AllowedMethods: define_method
|
|
314
|
+
Style/SymbolProc:
|
|
315
|
+
Exclude:
|
|
316
|
+
- 'spec/support/json_manager.rb'
|
|
317
|
+
|
|
318
|
+
# Offense count: 1
|
|
319
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
320
|
+
# Configuration parameters: EnforcedStyle, AllowSafeAssignment.
|
|
321
|
+
# SupportedStyles: require_parentheses, require_no_parentheses, require_parentheses_when_complex
|
|
322
|
+
Style/TernaryParentheses:
|
|
323
|
+
Exclude:
|
|
324
|
+
- 'lib/mongoid-cached-json/cached_json.rb'
|
|
325
|
+
|
|
326
|
+
# Offense count: 56
|
|
327
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
328
|
+
# Configuration parameters: AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, AllowRBSInlineAnnotation, AllowCopDirectives, AllowedPatterns, SplitStrings.
|
|
329
|
+
# URISchemes: http, https
|
|
330
|
+
Layout/LineLength:
|
|
331
|
+
Max: 202
|
data/CHANGELOG.md
CHANGED
|
@@ -1,90 +1,97 @@
|
|
|
1
|
-
1.
|
|
2
|
-
------------------
|
|
1
|
+
### 1.7.1 (Next)
|
|
3
2
|
|
|
4
|
-
*
|
|
3
|
+
* Your contribution here.
|
|
5
4
|
|
|
6
|
-
1.
|
|
7
|
-
------------------
|
|
5
|
+
### 1.7.0 (2026/10/16)
|
|
8
6
|
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
7
|
+
* [#33](https://github.com/mongoid/mongoid-cached-json/pull/33): Allow per-model cache bypass with `json_fields disable_caching: true` - [@dblock](https://github.com/dblock).
|
|
8
|
+
* [#32](https://github.com/mongoid/mongoid-cached-json/pull/32): Support opt-in declaration-time expansion of all stored fields with explicit overrides and computed fields - [@dblock](https://github.com/dblock).
|
|
9
|
+
* [#31](https://github.com/mongoid/mongoid-cached-json/pull/31): Add explicit per-model schema cache versions, independent of API versions - [@dblock](https://github.com/dblock).
|
|
10
|
+
* [#39](https://github.com/mongoid/mongoid-cached-json/pull/39): Check pull request changelogs with Danger and report results in PR comments - [@dblock](https://github.com/dblock).
|
|
11
|
+
* [#34](https://github.com/mongoid/mongoid-cached-json/pull/34): Support `cache: false` on individual JSON fields - [@dblock](https://github.com/dblock).
|
|
12
|
+
* [#36](https://github.com/mongoid/mongoid-cached-json/pull/36): Document cache invalidation boundaries for callback-bypassing and concurrent writes - [@dblock](https://github.com/dblock).
|
|
13
|
+
* [#35](https://github.com/mongoid/mongoid-cached-json/pull/35): Omit hidden child references while preserving `nil` for missing references (see [UPGRADING](UPGRADING.md) for migration notes) - [@dblock](https://github.com/dblock).
|
|
14
|
+
* [#38](https://github.com/mongoid/mongoid-cached-json/pull/38): Fix a `:reference` field returning `nil` instead of `false` when its definition evaluates to a false-y, non-nil value - [@mzikherman](https://github.com/mzikherman).
|
|
15
|
+
* [#30](https://github.com/mongoid/mongoid-cached-json/pull/30): Replace the obsolete quality badge with Coveralls, generate real SimpleCov coverage in one modern CI job, and scope badges to upstream master - [@dblock](https://github.com/dblock).
|
|
16
|
+
* [#30](https://github.com/mongoid/mongoid-cached-json/pull/30): Modernize CI with GitHub Actions, testing representative Ruby/Mongoid/MongoDB combinations through Ruby 4.0, Mongoid 9, and MongoDB Server 8.0, with modern memcached cache integration - [@dblock](https://github.com/dblock).
|
|
13
17
|
|
|
14
|
-
1.
|
|
15
|
-
--------------------
|
|
18
|
+
### 1.6.0 (2019/05/31)
|
|
16
19
|
|
|
17
|
-
*
|
|
20
|
+
* [#20](https://github.com/mongoid/mongoid-cached-json/pull/20): Compatibility with Ruby 2.3, 2.4, 2.5 and 2.6 - [@yuki24](https://github.com/yuki24).
|
|
21
|
+
* [#20](https://github.com/mongoid/mongoid-cached-json/pull/20): Compatibility with Mongoid 6 - [@yuki24](https://github.com/yuki24).
|
|
22
|
+
* [#20](https://github.com/mongoid/mongoid-cached-json/pull/20): No longer test against Ruby 1.9.3 - [@yuki24](https://github.com/yuki24).
|
|
23
|
+
* [#22](https://github.com/mongoid/mongoid-cached-json/pull/22): Compatibility with Mongoid 7 - [@yuki24](https://github.com/yuki24).
|
|
18
24
|
|
|
19
|
-
1.5 (
|
|
20
|
-
|
|
25
|
+
### 1.5.3 (2015/09/17)
|
|
26
|
+
|
|
27
|
+
* Compatibility with Mongoid 5 - [@dblock](https://github.com/dblock).
|
|
28
|
+
|
|
29
|
+
### 1.5.2 (2014/12/29)
|
|
30
|
+
|
|
31
|
+
* Fixed support for Ruby 2.2.0 - [@dblock](https://github.com/dblock).
|
|
32
|
+
* Implemented RuboCop, Ruby-style linter - [@dblock](https://github.com/dblock).
|
|
33
|
+
* Upgraded to RSpec 3.1 - [@dblock](https://github.com/dblock).
|
|
34
|
+
* Removed Jeweler - [@dblock](https://github.com/dblock).
|
|
35
|
+
|
|
36
|
+
### 1.5.1 (2013/05/07)
|
|
37
|
+
|
|
38
|
+
* Fixed `read_multi` calls so as to enable proper cache reading behavior in stores other than `ActiveSupport::Cache::DalliStore` - [@macreery](https://github.com/macreery).
|
|
39
|
+
|
|
40
|
+
### 1.5.0 (2013/04/13)
|
|
21
41
|
|
|
22
42
|
* Added `:reference_properties` that disables dynamic selection of the type of JSON to return for a reference - [@dblock](https://github.com/dblock).
|
|
23
43
|
|
|
24
|
-
1.4.3 (2013/01/25)
|
|
25
|
-
------------------
|
|
44
|
+
### 1.4.3 (2013/01/25)
|
|
26
45
|
|
|
27
46
|
* For caches that support `read_multi`, do not attempt to fetch JSON a second time via `fetch`, write it directly to cache - [@dblock](https://github.com/dblock).
|
|
28
47
|
|
|
29
|
-
1.4.2 (2013/01/24)
|
|
30
|
-
------------------
|
|
31
|
-
|
|
32
|
-
* Fix: calling `as_json` on a destroyed Mongoid 3.1 object with a HABTM relationship raises `undefined method 'map' for nil:NilClass` - [@dblock](http://github.com/dblock).
|
|
48
|
+
### 1.4.2 (2013/01/24)
|
|
33
49
|
|
|
34
|
-
|
|
35
|
-
------------------
|
|
50
|
+
* Fix: calling `as_json` on a destroyed Mongoid 3.1 object with a HABTM relationship raises `undefined method 'map' for nil:NilClass` - [@dblock](https://github.com/dblock).
|
|
36
51
|
|
|
37
|
-
|
|
38
|
-
* Do not invalidate cache when the document is created - [@dblock](http://github.com/dblock).
|
|
39
|
-
* Invalidate cache in `after_update` instead of `before_update` - [@dblock](http://github.com/dblock).
|
|
52
|
+
### 1.4.1 (2013/01/22)
|
|
40
53
|
|
|
41
|
-
|
|
42
|
-
|
|
54
|
+
* Invalidate cache in `after_destroy` - [@dblock](https://github.com/dblock).
|
|
55
|
+
* Do not invalidate cache when the document is created - [@dblock](https://github.com/dblock).
|
|
56
|
+
* Invalidate cache in `after_update` instead of `before_update` - [@dblock](https://github.com/dblock).
|
|
43
57
|
|
|
44
|
-
|
|
45
|
-
* Use `read_multi` if the cache store supports it to fetch data from cache in bulk - [@dblock](http://github.com/dblock), [@macreery](http://github.com/macreery).
|
|
46
|
-
* Added a benchmark test suite - [@dblock](http://github.com/dblock), [@macreery](http://github.com/macreery).
|
|
58
|
+
### 1.4.0 (2013/01/20)
|
|
47
59
|
|
|
48
|
-
|
|
49
|
-
|
|
60
|
+
* Collect a JSON partial representation first, then fetch data from cache only once per-key - [@dblock](https://github.com/dblock), [@macreery](https://github.com/macreery).
|
|
61
|
+
* Use `read_multi` if the cache store supports it to fetch data from cache in bulk - [@dblock](https://github.com/dblock), [@macreery](https://github.com/macreery).
|
|
62
|
+
* Added a benchmark test suite - [@dblock](https://github.com/dblock), [@macreery](https://github.com/macreery).
|
|
50
63
|
|
|
51
|
-
|
|
64
|
+
### 1.3.0 (2012/11/12)
|
|
52
65
|
|
|
53
|
-
|
|
54
|
-
------------------
|
|
66
|
+
* Removed requirement for `bson_ext`, support for Mongoid 3.0 - [@dblock](https://github.com/dblock).
|
|
55
67
|
|
|
56
|
-
|
|
68
|
+
### 1.2.3 (2012/07/03)
|
|
57
69
|
|
|
58
|
-
|
|
59
|
-
------------------
|
|
70
|
+
* Fix: including a `referenced_in` field in `json_fields` within a child `embedded_in` a parent causes an "access to the collection is not allowed since it is an embedded document" error - [@dblock](https://github.com/dblock).
|
|
60
71
|
|
|
61
|
-
|
|
72
|
+
### 1.2.2 (2012/07/03)
|
|
62
73
|
|
|
63
|
-
|
|
64
|
-
------------------
|
|
74
|
+
* Fix [#6](https://github.com/mongoid/mongoid-cached-json/issues/6): including parent in `json_fields` within a polymorphic reference fails with an "uninitialized constant" error - [@dblock](https://github.com/dblock).
|
|
65
75
|
|
|
66
|
-
|
|
76
|
+
### 1.2.1 (2012/06/12)
|
|
67
77
|
|
|
68
|
-
|
|
69
|
-
------------------
|
|
78
|
+
* Allow `nil` parameter in as_json - [@dblock](https://github.com/dblock).
|
|
70
79
|
|
|
71
|
-
|
|
80
|
+
### 1.2.0 (2012/05/28)
|
|
72
81
|
|
|
73
|
-
|
|
74
|
-
------------------
|
|
82
|
+
* Fix: cache key generation bug when using Mongoid 3 - [@marbemac](https://github.com/marbemac).
|
|
75
83
|
|
|
76
|
-
|
|
84
|
+
### 1.1.1 (2012/03/21)
|
|
77
85
|
|
|
78
|
-
|
|
79
|
-
----------------
|
|
86
|
+
* Fix: caching/invalidating referenced polymorphic documents - [@macreery](https://github.com/macreery).
|
|
80
87
|
|
|
81
|
-
|
|
88
|
+
### 1.1.0 (2012/02/29)
|
|
82
89
|
|
|
83
|
-
|
|
84
|
-
----------------
|
|
90
|
+
* Added support for versioning - [@dblock](https://github.com/dblock).
|
|
85
91
|
|
|
86
|
-
|
|
87
|
-
* Retired support for `:markdown` in favor of `Mongoid::CachedJson::transform` - [@dblock](http://github.com/dblock).
|
|
88
|
-
* Added `Mongoid::CachedJson::configure` - [@dblock](http://github.com/dblock).
|
|
89
|
-
* Added support for `:markdown` - [@macreery](http://github.com/macreery).
|
|
92
|
+
### 1.0.0 (2012/02/20)
|
|
90
93
|
|
|
94
|
+
* Initial release - [@aaw](https://github.com/aaw).
|
|
95
|
+
* Retired support for `:markdown` in favor of `Mongoid::CachedJson::transform` - [@dblock](https://github.com/dblock).
|
|
96
|
+
* Added `Mongoid::CachedJson::configure` - [@dblock](https://github.com/dblock).
|
|
97
|
+
* Added support for `:markdown` - [@macreery](https://github.com/macreery).
|