mongoid-cached-json 1.6.0 → 1.7.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.
data/CHANGELOG.md CHANGED
@@ -1,103 +1,101 @@
1
- 1.6.1 (Next)
2
- ------------
1
+ ### 1.7.1 (2026/11/24)
3
2
 
4
- * Your contribution here.
3
+ * [#40](https://github.com/mongoid/mongoid-cached-json/pull/40): Cover plain criteria and uncached transforms, and combine coverage across actual legacy and modern association APIs - [@dblock](https://github.com/dblock).
4
+ * [#46](https://github.com/mongoid/mongoid-cached-json/pull/46): Upgrade danger-pr-comment to 0.3.0 from the `danger` organization and skip empty Danger report comments - [@dblock](https://github.com/dblock).
5
+ * [#42](https://github.com/mongoid/mongoid-cached-json/pull/42): Lint Markdown, YAML, and spelling with rubocop-md, rubocop-prose, rubocop-spellcheck, and rubocop-yaml in a separate Lint workflow, and clean up documentation - [@dblock](https://github.com/dblock).
6
+ * [#43](https://github.com/mongoid/mongoid-cached-json/pull/43): Run CI pushes only on the default branch, cancel superseded pull request runs, skip duplicate lint in the test matrix, and bound job times - [@dblock](https://github.com/dblock).
7
+ * [#44](https://github.com/mongoid/mongoid-cached-json/pull/44): Release with ruby-gem-release from a manually dispatched GitHub Actions workflow using RubyGems Trusted Publishing, with dry runs - [@dblock](https://github.com/dblock).
5
8
 
6
- 1.6.0 (2019/05/31)
7
- ------------
9
+ ### 1.7.0 (2026/10/16)
8
10
 
9
- * [#20](https://github.com/mongoid/mongoid-cached-json/pull/20): Compatibility with Ruby 2.3, 2.4, 2.5 and 2.6 - [@yuki24](http://github.com/yuki24).
10
- * [#20](https://github.com/mongoid/mongoid-cached-json/pull/20): Compatibility with Mongoid 6 - [@yuki24](http://github.com/yuki24).
11
- * [#20](https://github.com/mongoid/mongoid-cached-json/pull/20): No longer test against Ruby 1.9.3 - [@yuki24](http://github.com/yuki24).
12
- * [#22](https://github.com/mongoid/mongoid-cached-json/pull/22): Compatibility with Mongoid 7 - [@yuki24](https://github.com/yuki24)
11
+ * [#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).
12
+ * [#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).
13
+ * [#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).
14
+ * [#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).
15
+ * [#34](https://github.com/mongoid/mongoid-cached-json/pull/34): Support `cache: false` on individual JSON fields - [@dblock](https://github.com/dblock).
16
+ * [#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).
17
+ * [#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).
18
+ * [#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).
19
+ * [#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).
20
+ * [#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
21
 
14
- 1.5.3 (2015/09/17)
15
- ------------------
22
+ ### 1.6.0 (2019/05/31)
16
23
 
17
- * Compatibility with Mongoid 5 - [@dblock](http://github.com/dblock).
24
+ * [#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).
25
+ * [#20](https://github.com/mongoid/mongoid-cached-json/pull/20): Compatibility with Mongoid 6 - [@yuki24](https://github.com/yuki24).
26
+ * [#20](https://github.com/mongoid/mongoid-cached-json/pull/20): No longer test against Ruby 1.9.3 - [@yuki24](https://github.com/yuki24).
27
+ * [#22](https://github.com/mongoid/mongoid-cached-json/pull/22): Compatibility with Mongoid 7 - [@yuki24](https://github.com/yuki24).
18
28
 
19
- 1.5.2 (2014/29/12)
20
- ------------------
29
+ ### 1.5.3 (2015/09/17)
21
30
 
22
- * Fixed support for Ruby 2.2.0 - [@dblock](http://github.com/dblock).
23
- * Implemented RuboCop, Ruby-style linter - [@dblock](http://github.com/dblock).
24
- * Upgraded to RSpec 3.1 - [@dblock](http://github.com/dblock).
25
- * Removed Jeweler - [@dblock](http://github.com/dblock).
31
+ * Compatibility with Mongoid 5 - [@dblock](https://github.com/dblock).
26
32
 
27
- 1.5.1 (2013/05/07)
28
- --------------------
33
+ ### 1.5.2 (2014/12/29)
29
34
 
30
- * Fixed `read_multi` calls so as to enable proper cache reading behavior in stores other than `ActiveSupport::Cache::DalliStore` - [@macreery](http://github.com/macreery).
35
+ * Fixed support for Ruby 2.2.0 - [@dblock](https://github.com/dblock).
36
+ * Implemented RuboCop, Ruby-style linter - [@dblock](https://github.com/dblock).
37
+ * Upgraded to RSpec 3.1 - [@dblock](https://github.com/dblock).
38
+ * Removed Jeweler - [@dblock](https://github.com/dblock).
31
39
 
32
- 1.5 (2013/04/13)
33
- ----------------
40
+ ### 1.5.1 (2013/05/07)
41
+
42
+ * Fixed `read_multi` calls so as to enable proper cache reading behavior in stores other than `ActiveSupport::Cache::DalliStore` - [@macreery](https://github.com/macreery).
43
+
44
+ ### 1.5.0 (2013/04/13)
34
45
 
35
46
  * Added `:reference_properties` that disables dynamic selection of the type of JSON to return for a reference - [@dblock](https://github.com/dblock).
36
47
 
37
- 1.4.3 (2013/01/25)
38
- ------------------
48
+ ### 1.4.3 (2013/01/25)
39
49
 
40
50
  * 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).
41
51
 
42
- 1.4.2 (2013/01/24)
43
- ------------------
44
-
45
- * 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).
52
+ ### 1.4.2 (2013/01/24)
46
53
 
47
- 1.4.1 (2013/01/22)
48
- ------------------
54
+ * 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).
49
55
 
50
- * Invalidate cache in `after_destroy` - [@dblock](http://github.com/dblock).
51
- * Do not invalidate cache when the document is created - [@dblock](http://github.com/dblock).
52
- * Invalidate cache in `after_update` instead of `before_update` - [@dblock](http://github.com/dblock).
56
+ ### 1.4.1 (2013/01/22)
53
57
 
54
- 1.4 (2013/01/20)
55
- ---------------
58
+ * Invalidate cache in `after_destroy` - [@dblock](https://github.com/dblock).
59
+ * Do not invalidate cache when the document is created - [@dblock](https://github.com/dblock).
60
+ * Invalidate cache in `after_update` instead of `before_update` - [@dblock](https://github.com/dblock).
56
61
 
57
- * Collect a JSON partial representation first, then fetch data from cache only once per-key - [@dblock](http://github.com/dblock), [@macreery](http://github.com/macreery).
58
- * 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).
59
- * Added a benchmark test suite - [@dblock](http://github.com/dblock), [@macreery](http://github.com/macreery).
62
+ ### 1.4.0 (2013/01/20)
60
63
 
61
- 1.3 (2012/11/12)
62
- ----------------
64
+ * 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).
65
+ * 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).
66
+ * Added a benchmark test suite - [@dblock](https://github.com/dblock), [@macreery](https://github.com/macreery).
63
67
 
64
- * Removed requirement for `bson_ext`, support for Mongoid 3.0 - [@dblock](http://github.com/dblock).
68
+ ### 1.3.0 (2012/11/12)
65
69
 
66
- 1.2.3 (2012/07/03)
67
- ------------------
70
+ * Removed requirement for `bson_ext`, support for Mongoid 3.0 - [@dblock](https://github.com/dblock).
68
71
 
69
- * 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](http://github.com/dblock).
72
+ ### 1.2.3 (2012/07/03)
70
73
 
71
- 1.2.2 (2012/07/03)
72
- ------------------
74
+ * 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).
73
75
 
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](http://github.com/dblock).
76
+ ### 1.2.2 (2012/07/03)
75
77
 
76
- 1.2.1 (2012/06/12)
77
- ------------------
78
+ * 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).
78
79
 
79
- * Allow `nil` parameter in as_json - [@dblock](http://github.com/dblock).
80
+ ### 1.2.1 (2012/06/12)
80
81
 
81
- 1.2.0 (2012/05/28)
82
- ------------------
82
+ * Allow `nil` parameter in as_json - [@dblock](https://github.com/dblock).
83
83
 
84
- * Fix: cache key generation bug when using Mongoid 3 - [@marbemac](http://github.com/marbemac).
84
+ ### 1.2.0 (2012/05/28)
85
85
 
86
- 1.1.1 (2012/03/21)
87
- ------------------
86
+ * Fix: cache key generation bug when using Mongoid 3 - [@marbemac](https://github.com/marbemac).
88
87
 
89
- * Fix: caching/invalidating referenced polymorphic documents - [@macreery](http://github.com/macreery).
88
+ ### 1.1.1 (2012/03/21)
90
89
 
91
- 1.1 (2012/02/29)
92
- ----------------
90
+ * Fix: caching/invalidating referenced polymorphic documents - [@macreery](https://github.com/macreery).
93
91
 
94
- * Added support for versioning - [@dblock](http://github.com/dblock).
92
+ ### 1.1.0 (2012/02/29)
95
93
 
96
- 1.0 (2012/02/20)
97
- ----------------
94
+ * Added support for versioning - [@dblock](https://github.com/dblock).
98
95
 
99
- * Initial release - [@aaw](http://github.com/aaw).
100
- * Retired support for `:markdown` in favor of `Mongoid::CachedJson::transform` - [@dblock](http://github.com/dblock).
101
- * Added `Mongoid::CachedJson::configure` - [@dblock](http://github.com/dblock).
102
- * Added support for `:markdown` - [@macreery](http://github.com/macreery).
96
+ ### 1.0.0 (2012/02/20)
103
97
 
98
+ * Initial release - [@aaw](https://github.com/aaw).
99
+ * Retired support for `:markdown` in favor of `Mongoid::CachedJson::transform` - [@dblock](https://github.com/dblock).
100
+ * Added `Mongoid::CachedJson::configure` - [@dblock](https://github.com/dblock).
101
+ * Added support for `:markdown` - [@macreery](https://github.com/macreery).
data/CONTRIBUTING.md CHANGED
@@ -1,23 +1,22 @@
1
- Contributing to Mongoid::CachedJson
2
- ===================================
1
+ # Contributing to Mongoid::CachedJson
3
2
 
4
- Mongoid::CachedJson is work of [many of contributors](https://github.com/mongoid/mongoid-cached-json/graphs/contributors). You're encouraged to submit [pull requests](https://github.com/mongoid/mongoid-cached-json/pulls), [propose features and discuss issues](https://github.com/mongoid/mongoid-cached-json/issues). When in doubt, ask a question in the [Google Group](http://groups.google.com/group/mongoid-cached-json).
3
+ Mongoid::CachedJson is the work of [many contributors](https://github.com/mongoid/mongoid-cached-json/graphs/contributors). You're encouraged to submit [pull requests](https://github.com/mongoid/mongoid-cached-json/pulls), [propose features and discuss issues](https://github.com/mongoid/mongoid-cached-json/issues). When in doubt, ask a question in the [Google Group](http://groups.google.com/group/mongoid-cached-json).
5
4
 
6
- #### Fork the Project
5
+ ## Fork the Project
7
6
 
8
- Fork the [project on Github](https://github.com/mongoid/mongoid-cached-json) and check out your copy.
7
+ Fork the [project on GitHub](https://github.com/mongoid/mongoid-cached-json) and check out your copy.
9
8
 
10
- ```
9
+ ```sh
11
10
  git clone https://github.com/contributor/mongoid-cached-json.git
12
11
  cd mongoid-cached-json
13
12
  git remote add upstream https://github.com/mongoid/mongoid-cached-json.git
14
13
  ```
15
14
 
16
- #### Create a Topic Branch
15
+ ### Create a Topic Branch
17
16
 
18
17
  Make sure your fork is up-to-date and create a topic branch for your feature or bug fix.
19
18
 
20
- ```
19
+ ```sh
21
20
  git checkout master
22
21
  git pull upstream master
23
22
  git checkout -b my-feature-branch
@@ -27,7 +26,7 @@ git checkout -b my-feature-branch
27
26
 
28
27
  MongoDB and Memcached are required, use your favorite OS installer.
29
28
 
30
- ```
29
+ ```sh
31
30
  brew install mongodb
32
31
  brew install memcached
33
32
  ```
@@ -36,7 +35,7 @@ brew install memcached
36
35
 
37
36
  Ensure that you can build the project and run tests.
38
37
 
39
- ```
38
+ ```sh
40
39
  bundle install
41
40
  bundle exec rake
42
41
  ```
@@ -51,7 +50,7 @@ We definitely appreciate pull requests that highlight or reproduce a problem, ev
51
50
 
52
51
  Implement your feature or bug fix.
53
52
 
54
- Ruby style is enforced with [Rubocop](https://github.com/bbatsov/rubocop), run `bundle exec rubocop` and fix any style issues highlighted.
53
+ Ruby style is enforced with [RuboCop](https://github.com/bbatsov/rubocop), run `bundle exec rubocop` and fix any style issues highlighted.
55
54
 
56
55
  Make sure that `bundle exec rake` completes without errors.
57
56
 
@@ -61,27 +60,29 @@ Document any external behavior in the [README](README.md).
61
60
 
62
61
  #### Update Changelog
63
62
 
64
- Add a line to [CHANGELOG](CHANGELOG.md) under *Next Release*. Make it look like every other line, including your name and link to your Github account.
63
+ Add a line to [CHANGELOG](CHANGELOG.md) under *Next Release*. Make it look like every other line, including your name and link to your GitHub account.
64
+
65
+ Danger checks pull requests with `danger-changelog` and reports missing changelog entries in a PR comment. Include the pull request number in your entry once it is available.
65
66
 
66
67
  #### Commit Changes
67
68
 
68
69
  Make sure git knows your name and email address:
69
70
 
70
- ```
71
+ ```sh
71
72
  git config --global user.name "Your Name"
72
73
  git config --global user.email "contributor@example.com"
73
74
  ```
74
75
 
75
76
  Writing good commit logs is important. A commit log should describe what changed and why.
76
77
 
77
- ```
78
+ ```sh
78
79
  git add ...
79
80
  git commit
80
81
  ```
81
82
 
82
83
  #### Push
83
84
 
84
- ```
85
+ ```sh
85
86
  git push origin my-feature-branch
86
87
  ```
87
88
 
@@ -93,7 +94,7 @@ Go to https://github.com/contributor/mongoid-cached-json and select your feature
93
94
 
94
95
  If you've been working on a change for a while, rebase with upstream/master.
95
96
 
96
- ```
97
+ ```sh
97
98
  git fetch upstream
98
99
  git rebase upstream/master
99
100
  git push origin my-feature-branch -f
@@ -103,20 +104,20 @@ git push origin my-feature-branch -f
103
104
 
104
105
  Update the [CHANGELOG](CHANGELOG.md) with the pull request number. A typical entry looks as follows.
105
106
 
106
- ```
107
+ ```markdown
107
108
  * [#123](https://github.com/mongoid/mongoid-cached-json/pull/123): Reticulated splines - [@contributor](https://github.com/contributor).
108
109
  ```
109
110
 
110
111
  Amend your previous commit and force push the changes.
111
112
 
112
- ```
113
+ ```sh
113
114
  git commit --amend
114
115
  git push origin my-feature-branch -f
115
116
  ```
116
117
 
117
118
  #### Check on Your Pull Request
118
119
 
119
- Go back to your pull request after a few minutes and see whether it passed muster with Travis-CI. Everything should look green, otherwise fix issues and amend your commit as described above.
120
+ Go back to your pull request after a few minutes and see whether it passed muster with GitHub Actions. Everything should look green, otherwise fix issues and amend your commit as described above.
120
121
 
121
122
  #### Be Patient
122
123
 
data/Dangerfile ADDED
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ danger.import_dangerfile(gem: 'danger-pr-comment')
4
+
5
+ changelog.check!
data/Gemfile CHANGED
@@ -1,30 +1,39 @@
1
- source 'http://rubygems.org'
1
+ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
5
- case version = ENV['MONGOID_VERSION'] || '~> 5.0'
6
- when /7/
7
- gem 'mongoid', '~> 7.0'
8
- when /6/
9
- gem 'mongoid', '~> 6.0'
10
- when /5/
11
- gem 'mongoid', '~> 5.0'
12
- when /4/
13
- gem 'mongoid', '~> 4.0'
14
- when /3/
15
- gem 'mongoid', '~> 3.1'
16
- else
17
- gem 'mongoid', version
18
- end
5
+ version = ENV['MONGOID_VERSION'] || '9'
6
+ gem 'bigdecimal' if RUBY_VERSION >= '3.4'
7
+ gem 'logger' if RUBY_VERSION >= '3.4'
8
+ gem 'mongoid', version =~ /\A\d+\z/ ? "~> #{version}.0" : version
19
9
 
20
10
  group :development do
21
- gem 'dalli', '~> 2.6'
11
+ if RUBY_VERSION >= '2.7'
12
+ gem 'danger'
13
+ gem 'danger-changelog', require: false
14
+ gem 'danger-pr-comment', require: false
15
+ end
16
+ gem 'dalli', RUBY_VERSION >= '3.0' ? '~> 3.0' : '~> 2.6'
22
17
  gem 'rake'
23
- gem 'rubocop'
18
+ gem 'rdoc', RUBY_VERSION >= '3.0' ? '>= 6' : '~> 4.2'
24
19
  gem 'yard', '~> 0.6'
25
20
  end
26
21
 
27
22
  group :test do
28
23
  gem 'mongoid-compatibility'
29
24
  gem 'rspec', '~> 3.1'
25
+ gem 'simplecov', '~> 0.22' if ENV['COVERAGE'] == 'true'
26
+ end
27
+
28
+ group :development, :test do
29
+ if RUBY_ENGINE == 'ruby' && Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.3')
30
+ gem 'commonmarker', '~> 2.10', require: false
31
+ gem 'rubocop', '~> 1.92'
32
+ gem 'rubocop-md', '~> 3.0', require: false
33
+ gem 'rubocop-prose', '~> 0.2', require: false
34
+ gem 'rubocop-rake', '~> 0.7', require: false
35
+ gem 'rubocop-spellcheck', '~> 0.2', require: false
36
+ gem 'rubocop-yaml', '~> 0.1.0', require: false
37
+ gem 'ruby-gem-release', '0.9.0', require: false
38
+ end
30
39
  end