cache_key_for 0.1.10 → 0.1.11
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/Gemfile.lock +1 -1
- data/lib/cache_key_for/cache_key_for_helper.rb +10 -5
- data/lib/cache_key_for/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 980e594120deb83114f6b9846b81ead0e0fc59a4
|
4
|
+
data.tar.gz: e3b7ad9517f78de61c8b23262073b6ce187101f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85e0be361c876f0794afb88f54b37586c67012d6f0ca47408dc5d046e35343a0d07a945595ff9f495774b6662f4e92f282b492cae3cbf71b6211a9b569368720
|
7
|
+
data.tar.gz: b4e622b6ce9ed09a875c984c4a09d7ad5f75bc726d953828b7fff772dfb74662337671c17199dd6c36b96e65379a9a8c131efb0e8f5fe17f5cd5ef1fd1ad1a8e
|
data/Gemfile.lock
CHANGED
@@ -67,10 +67,15 @@ module CacheKeyForHelper
|
|
67
67
|
else # Array or not paginated scope
|
68
68
|
scoped_collection.count
|
69
69
|
end
|
70
|
-
if scoped_collection.respond_to?(:ids)
|
71
|
-
|
70
|
+
ids_string = if scoped_collection.respond_to?(:ids)
|
71
|
+
begin
|
72
|
+
scoped_collection.ids
|
73
|
+
rescue ActiveRecord::EagerLoadPolymorphicError
|
74
|
+
Rails.logger.debug "[CacheKeyForHelper] Fallback to array (ActiveRecord::EagerLoadPolymorphicError)"
|
75
|
+
scoped_collection.to_a.map(&:id).join('-')
|
76
|
+
end
|
72
77
|
else
|
73
|
-
|
78
|
+
scoped_collection.to_a.map(&:id).join('-')
|
74
79
|
end
|
75
80
|
blacklist_params = ['utm_source', 'utm_medium', 'utm_term', 'utm_content', 'utm_campaign']
|
76
81
|
flat_request_params = if request.params
|
@@ -87,8 +92,8 @@ module CacheKeyForHelper
|
|
87
92
|
end
|
88
93
|
digest = Digest::SHA1.hexdigest("#{ids_string}-#{max_updated_at}-#{count}-#{request.subdomains.join('.')}-#{request.path}-#{flat_request_params}")
|
89
94
|
# puts "Caller: #{caller.first}"
|
90
|
-
puts "generated cache key digest base: #{ids_string}-#{max_updated_at}-#{count}-#{request.subdomains.join('.')}-#{request.path}-#{flat_request_params}"
|
91
|
-
puts "generated cache key: #{I18n.locale}/#{collection_prefix}/#{digest}/#{cache_owner_cache_key}/#{suffix}"
|
95
|
+
# puts "generated cache key digest base: #{ids_string}-#{max_updated_at}-#{count}-#{request.subdomains.join('.')}-#{request.path}-#{flat_request_params}"
|
96
|
+
# puts "generated cache key: #{I18n.locale}/#{collection_prefix}/#{digest}/#{cache_owner_cache_key}/#{suffix}"
|
92
97
|
"#{I18n.locale}/#{collection_prefix}/#{digest}/#{cache_owner_cache_key}/#{suffix}"
|
93
98
|
end
|
94
99
|
end
|