Skip to content

Commit 6a90712

Browse files
authored
try out a hackaround for fixing getting the root attachment (#131)
* try out a hackaround for fixing getting the root attachment seems the attach method changed from rails 5-6 to return true instead of the newly attached attachment? * re-add the rescue for error messages
1 parent 183cff4 commit 6a90712

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/webpage_cache_service/cache.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def get uri:
9696

9797
# Without manually managing the temp file, there isn't an easy way to
9898
# breakup the following logic but I did my best and fuck you too rubocop
99-
attachments = binary_temp_file do |temp_file|
99+
binary_temp_file do |temp_file|
100100
write_body response: response, to: temp_file
101101

102102
content_type = get_content_type(response: response, io: temp_file)
@@ -110,7 +110,7 @@ def get uri:
110110
)
111111
end
112112

113-
attachment = attachments.first
113+
attachment = offline_cache.assets.order(:id).first
114114

115115
[ response, attachment ]
116116
end

0 commit comments

Comments
 (0)