active_model_serializers 0.10.14 → 0.10.15
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 73410f3d582bb13e0defcc9307f99db6ac93aa10fe932e6143fc1de8607f4353
|
4
|
+
data.tar.gz: 02fb3af2ac4e0e934d0ed1671f29bf75a31b55c59c1c9b0174110c124ca84945
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '088a11c94eec3f4ab853733bd24e23718c775523ad3b39edeb7a7f2b82de75cb8b34c8f5ea5d8f662a17a15ec5358d503233a157123924ce89fd574bcb3719ca'
|
7
|
+
data.tar.gz: c762792c1af5084fe4d56172ab216a5bc166765ff4df7e440f855282dbd6003f3738134ed3fae34ac4ca8b05baa10064a0b021f1c0c4013258ceebb71bfb6fe9
|
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.15...0-10-stable)
|
4
4
|
|
5
5
|
Breaking changes:
|
6
6
|
|
@@ -10,6 +10,16 @@ Fixes:
|
|
10
10
|
|
11
11
|
Misc:
|
12
12
|
|
13
|
+
### [v0.10.15 (2024-11-30)](https://github.com/rails-api/active_model_serializers/compare/v0.10.14...v0.10.15)
|
14
|
+
|
15
|
+
Fixes:
|
16
|
+
- [#2482](https://github.com/rails-api/active_model_serializers/pull/2482) Fix cant modify frozen Hash error due to rails changes (@vineelvineel)
|
17
|
+
- [#2460](https://github.com/rails-api/active_model_serializers/pull/2460) Don't force ActionController::TestCase to load (@eugeneius)
|
18
|
+
|
19
|
+
Misc:
|
20
|
+
- [#2483](https://github.com/rails-api/active_model_serializers/pull/2483) Support Rails 8 (@pulkit110)
|
21
|
+
|
22
|
+
|
13
23
|
### [v0.10.14 (2023-10-05)](https://github.com/rails-api/active_model_serializers/compare/v0.10.13...v0.10.14)
|
14
24
|
|
15
25
|
Breaking changes:
|
@@ -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.15
|
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: 2024-12-01 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
|