active_model_serializers 0.10.14 → 0.10.16
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/CHANGELOG.md +17 -1
- data/lib/active_model/serializer/version.rb +1 -1
- data/lib/active_model/serializer.rb +4 -1
- data/lib/active_model_serializers/adapter/attributes.rb +1 -1
- data/lib/active_model_serializers/railtie.rb +12 -2
- metadata +3 -4
- data/lib/active_model_serializers/model/caching.rb +0 -26
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8cdd0b3976839d4440272bffdeb4acac4029cec689a3ce027d903b47a58653f1
|
|
4
|
+
data.tar.gz: 77cdf909e0e753840a0500fa10fde3eb372a7690dca150c4237387b6e6fb4583
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ef0cacdcd276a12bdbe52fa6d10942050d44d651c40b7d9e3dcf7c28d8ddceb3d68bcee9432860ef7c25853395d23d6cfd6fa9aef4c689b35d47942c9adb4f80
|
|
7
|
+
data.tar.gz: 7af99806ceaa3b440d2f41238b60baf7e19a053c501bbc879f118e70de016c3d3c2d91ad544db386f36147b1d5668f25f42a6b81558cbbad320649e1b02ce417
|
data/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
## 0.10.x
|
|
2
2
|
|
|
3
|
-
### [master (unreleased)](https://github.com/rails-api/active_model_serializers/compare/v0.10.
|
|
3
|
+
### [master (unreleased)](https://github.com/rails-api/active_model_serializers/compare/v0.10.16...0-10-stable)
|
|
4
4
|
|
|
5
5
|
Breaking changes:
|
|
6
6
|
|
|
@@ -10,6 +10,22 @@ Fixes:
|
|
|
10
10
|
|
|
11
11
|
Misc:
|
|
12
12
|
|
|
13
|
+
### [v0.10.16 (2025-12-05)](https://github.com/rails-api/active_model_serializers/compare/v0.10.15...v0.10.16)
|
|
14
|
+
|
|
15
|
+
Misc:
|
|
16
|
+
- [#2492](https://github.com/rails-api/active_model_serializers/pull/2492) Remove use of ActiveSupport::Configurable (@t27duck)
|
|
17
|
+
- [#2495](https://github.com/rails-api/active_model_serializers/pull/2495) Fix changing config in subclass having global effect (@janko)
|
|
18
|
+
|
|
19
|
+
### [v0.10.15 (2024-11-30)](https://github.com/rails-api/active_model_serializers/compare/v0.10.14...v0.10.15)
|
|
20
|
+
|
|
21
|
+
Fixes:
|
|
22
|
+
- [#2482](https://github.com/rails-api/active_model_serializers/pull/2482) Fix cant modify frozen Hash error due to rails changes (@vineelvineel)
|
|
23
|
+
- [#2460](https://github.com/rails-api/active_model_serializers/pull/2460) Don't force ActionController::TestCase to load (@eugeneius)
|
|
24
|
+
|
|
25
|
+
Misc:
|
|
26
|
+
- [#2483](https://github.com/rails-api/active_model_serializers/pull/2483) Support Rails 8 (@pulkit110)
|
|
27
|
+
|
|
28
|
+
|
|
13
29
|
### [v0.10.14 (2023-10-05)](https://github.com/rails-api/active_model_serializers/compare/v0.10.13...v0.10.14)
|
|
14
30
|
|
|
15
31
|
Breaking changes:
|
|
@@ -13,6 +13,9 @@ require 'active_model/serializer/lint'
|
|
|
13
13
|
# reified when subclassed to decorate a resource.
|
|
14
14
|
module ActiveModel
|
|
15
15
|
class Serializer
|
|
16
|
+
class_attribute :config
|
|
17
|
+
self.config = ActiveSupport::OrderedOptions.new
|
|
18
|
+
|
|
16
19
|
undef_method :select, :display # These IO methods, which are mixed into Kernel,
|
|
17
20
|
# sometimes conflict with attribute names. We don't need these IO methods.
|
|
18
21
|
|
|
@@ -30,7 +33,6 @@ module ActiveModel
|
|
|
30
33
|
autoload :HasOneReflection
|
|
31
34
|
autoload :HasManyReflection
|
|
32
35
|
end
|
|
33
|
-
include ActiveSupport::Configurable
|
|
34
36
|
include Caching
|
|
35
37
|
|
|
36
38
|
# @param resource [ActiveRecord::Base, ActiveModelSerializers::Model]
|
|
@@ -190,6 +192,7 @@ module ActiveModel
|
|
|
190
192
|
base._attributes_data = _attributes_data.dup
|
|
191
193
|
base._reflections = _reflections.dup
|
|
192
194
|
base._links = _links.dup
|
|
195
|
+
base.config = ActiveSupport::InheritableOptions.new(config)
|
|
193
196
|
end
|
|
194
197
|
|
|
195
198
|
# @return [Array<Symbol>] Key names of declared attributes
|
|
@@ -9,7 +9,7 @@ module ActiveModelSerializers
|
|
|
9
9
|
end
|
|
10
10
|
|
|
11
11
|
def serializable_hash(options = nil)
|
|
12
|
-
options = serialization_options(options)
|
|
12
|
+
options = serialization_options(options.dup)
|
|
13
13
|
options[:fields] ||= instance_options[:fields]
|
|
14
14
|
serialized_hash = serializer.serializable_hash(instance_options, options, self)
|
|
15
15
|
|
|
@@ -44,9 +44,19 @@ module ActiveModelSerializers
|
|
|
44
44
|
end
|
|
45
45
|
# :nocov:
|
|
46
46
|
|
|
47
|
+
def extend_action_controller_test_case(&block)
|
|
48
|
+
if Rails::VERSION::MAJOR >= 6 || Rails::VERSION::MAJOR == 5 && Rails::VERSION::MINOR >= 2
|
|
49
|
+
ActiveSupport.on_load(:action_controller_test_case, run_once: true, &block)
|
|
50
|
+
else
|
|
51
|
+
ActionController::TestCase.instance_eval(&block)
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
|
|
47
55
|
if Rails.env.test?
|
|
48
|
-
|
|
49
|
-
|
|
56
|
+
extend_action_controller_test_case do
|
|
57
|
+
include ActiveModelSerializers::Test::Schema
|
|
58
|
+
include ActiveModelSerializers::Test::Serializer
|
|
59
|
+
end
|
|
50
60
|
end
|
|
51
61
|
end
|
|
52
62
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: active_model_serializers
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.10.
|
|
4
|
+
version: 0.10.16
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Steve Klabnik
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2025-12-08 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activemodel
|
|
@@ -284,7 +284,6 @@ files:
|
|
|
284
284
|
- lib/active_model_serializers/logging.rb
|
|
285
285
|
- lib/active_model_serializers/lookup_chain.rb
|
|
286
286
|
- lib/active_model_serializers/model.rb
|
|
287
|
-
- lib/active_model_serializers/model/caching.rb
|
|
288
287
|
- lib/active_model_serializers/railtie.rb
|
|
289
288
|
- lib/active_model_serializers/register_jsonapi_renderer.rb
|
|
290
289
|
- lib/active_model_serializers/serializable_resource.rb
|
|
@@ -319,7 +318,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
319
318
|
- !ruby/object:Gem::Version
|
|
320
319
|
version: '0'
|
|
321
320
|
requirements: []
|
|
322
|
-
rubygems_version: 3.
|
|
321
|
+
rubygems_version: 3.3.7
|
|
323
322
|
signing_key:
|
|
324
323
|
specification_version: 4
|
|
325
324
|
summary: Conventions-based JSON generation for Rails.
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
module ActiveModelSerializers
|
|
3
|
-
class Model
|
|
4
|
-
module Caching
|
|
5
|
-
extend ActiveSupport::Concern
|
|
6
|
-
|
|
7
|
-
included do
|
|
8
|
-
attr_writer :updated_at
|
|
9
|
-
attributes :id
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
# Defaults to the downcased model name and updated_at
|
|
13
|
-
def cache_key
|
|
14
|
-
ActiveSupport::Cache.expand_cache_key([
|
|
15
|
-
self.class.model_name.name.downcase,
|
|
16
|
-
"#{id}-#{updated_at.strftime('%Y%m%d%H%M%S%9N')}"
|
|
17
|
-
].compact)
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
# Defaults to the time the serializer file was modified.
|
|
21
|
-
def updated_at
|
|
22
|
-
defined?(@updated_at) ? @updated_at : File.mtime(__FILE__)
|
|
23
|
-
end
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
end
|