rails_json_serializer 1.1.0 → 1.1.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.
- checksums.yaml +4 -4
- data/lib/serializer/concern.rb +4 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0bd106c9225455d6c867d24cb50b6e06b012aea9f5faeccfab3b8a818756234e
|
4
|
+
data.tar.gz: 85474e86d17b95e799a8178568cea0969f960ecb846e637133e299945ffea14b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d4ea1eaea84942b02b9b756614443b4cb84075b5c598465d220e5831c2628fb1dcacc7191ec3dabaabf33f1380bae1d6bbcb1739f610452581b3c1e6f62b664
|
7
|
+
data.tar.gz: 9a5130aa48afcc73ee428f72315c24060e3606a75717c22268c4aa3e221169a2373d55eccbe348cfcc4a27fbab43fea769a1eaed210ba3c8248ec2aa438c2396
|
data/lib/serializer/concern.rb
CHANGED
@@ -5,9 +5,9 @@ module Serializer
|
|
5
5
|
|
6
6
|
# START MODEL INSTANCE METHODS
|
7
7
|
def clear_serializer_cache
|
8
|
-
if self.class.const_defined?("
|
9
|
-
|
10
|
-
|
8
|
+
if self.class.const_defined?("SerializerCacheQueryKeys")
|
9
|
+
list_of_serializer_query_names = "#{self.class.name}::SerializerCacheQueryKeys".constantize
|
10
|
+
list_of_serializer_query_names.each do |query_name|
|
11
11
|
cache_key = "#{self.class.name}_____#{query_name}___#{self.id}"
|
12
12
|
Rails.logger.info "Serializer: CLEARING CACHE KEY: #{cache_key}" if Serializer.configuration.debug
|
13
13
|
Rails.cache.delete(cache_key)
|
@@ -108,7 +108,7 @@ module Serializer
|
|
108
108
|
# Injecting the Serializer Methods as a namespaced class of the rails class, so we can have
|
109
109
|
# access to the list of methods to clear their cache.
|
110
110
|
# 'Class Name + Serializer' does not work with inheritence.
|
111
|
-
subclass.const_set('
|
111
|
+
subclass.const_set('SerializerCacheQueryKeys', serializer_klass.public_instance_methods)
|
112
112
|
else
|
113
113
|
Rails.logger.info "Serializer: #{serializer_klass.name} was not a Module as expected" if Serializer.configuration.debug
|
114
114
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_json_serializer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- benjamin.dana.software.dev@gmail.com
|
@@ -53,7 +53,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
requirements: []
|
56
|
-
rubygems_version: 3.
|
56
|
+
rubygems_version: 3.0.8
|
57
57
|
signing_key:
|
58
58
|
specification_version: 4
|
59
59
|
summary: An ActiveRecord JSON Serializer with supported caching and eager-loading
|