diff --git a/rubygem-actionview-7.0.7-Handle-non-string-partial-body-in-ActionView-CollectionCaching.patch b/rubygem-actionview-7.0.7-Handle-non-string-partial-body-in-ActionView-CollectionCaching.patch deleted file mode 100644 index 924fbea..0000000 --- a/rubygem-actionview-7.0.7-Handle-non-string-partial-body-in-ActionView-CollectionCaching.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 6db11339f4ed33d7593b428e39da73d6e06511af Mon Sep 17 00:00:00 2001 -From: Jean Boussier -Date: Mon, 14 Aug 2023 11:20:43 +0200 -Subject: [PATCH] Handle non-string partial body in - ActionView::CollectionCaching - -Followup: https://github.com/rails/rails/pull/48645 - -Some template engines such as `jbuilder` use these Action View primitives -with types other than strings, which breaks a bunch of assumptions. - -I wish I could add a test for this, but this is deep in private methods -I don't see a way to cover this. ---- - actionview/CHANGELOG.md | 7 +++++++ - .../renderer/partial_renderer/collection_caching.rb | 11 +++++++++-- - 2 files changed, 16 insertions(+), 2 deletions(-) - -diff --git a/actionview/CHANGELOG.md b/actionview/CHANGELOG.md -index 3f5a19dc26c03..676610c97673c 100644 ---- a/actionview/CHANGELOG.md -+++ b/actionview/CHANGELOG.md -@@ -1,3 +1,10 @@ -+* Fix `render collection: @records, cache: true` inside `jbuilder` templates -+ -+ The previous fix that shipped in `7.0.7` assumed template fragments are always strings, -+ this isn't true with `jbuilder`. -+ -+ *Jean Boussier* -+ - ## Rails 7.0.7.2 (August 22, 2023) ## - - * No changes. -diff --git a/actionview/lib/action_view/renderer/partial_renderer/collection_caching.rb b/actionview/lib/action_view/renderer/partial_renderer/collection_caching.rb -index b63baf54efd15..4a12c28eabdcb 100644 ---- a/actionview/lib/action_view/renderer/partial_renderer/collection_caching.rb -+++ b/actionview/lib/action_view/renderer/partial_renderer/collection_caching.rb -@@ -95,9 +95,16 @@ def fetch_or_cache_partial(cached_partials, template, order_by:) - build_rendered_template(content, template) - else - rendered_partial = yield -- if fragment = rendered_partial.body&.to_str -- entries_to_write[cache_key] = fragment -+ body = rendered_partial.body -+ -+ # We want to cache buffers as raw strings. This both improve performance and -+ # avoid creating forward compatibility issues with the internal representation -+ # of these two types. -+ if body.is_a?(ActiveSupport::SafeBuffer) -+ body = body.to_str - end -+ -+ entries_to_write[cache_key] = body - rendered_partial - end - end diff --git a/rubygem-actionview.spec b/rubygem-actionview.spec index afaae4b..9c328e1 100644 --- a/rubygem-actionview.spec +++ b/rubygem-actionview.spec @@ -1,11 +1,11 @@ %global gem_name actionview # Circular dependency with rubygem-railties. -%bcond_with bootstrap +%bcond_without bootstrap Name: rubygem-%{gem_name} -Version: 7.0.7.2 -Release: 2%{?dist} +Version: 7.0.8 +Release: 1%{?dist} Summary: Rendering framework putting the V in MVC (part of Rails) License: MIT URL: http://rubyonrails.org @@ -13,23 +13,18 @@ Source0: https://rubygems.org/gems/%{gem_name}-%{version}%{?prerelease}.gem # The gem doesn't ship with the test suite. # You may check it out like so # git clone http://github.com/rails/rails.git -# cd rails/actionview && git archive -v -o actionview-7.0.7.2-tests.txz v7.0.7.2 test/ +# cd rails/actionview && git archive -v -o actionview-7.0.8-tests.txz v7.0.8 test/ Source1: %{gem_name}-%{version}%{?prerelease}-tests.txz # The tools are needed for the test suite, are however unpackaged in gem file. # You may get them like so # git clone http://github.com/rails/rails.git --no-checkout -# cd rails && git archive -v -o rails-7.0.7.2-tools.txz v7.0.7.2 tools/ +# cd rails && git archive -v -o rails-7.0.8-tools.txz v7.0.8 tools/ Source2: rails-%{version}%{?prerelease}-tools.txz # Fixes for Minitest 5.16+ # https://github.com/rails/rails/pull/45380 Patch0: rubygem-actionview-7.0.2.3-Remove-the-multi-call-form-of-assert_called_with.patch # https://github.com/rails/rails/pull/45370 Patch1: rubygem-actionview-7.0.2.3-Fix-tests-for-minitest-5.16.patch -# Fixes jbuilder test errors: -# JbuilderTemplateTest#test_supports_the_cached:_->()_{}_option -# JbuilderTemplateTest#test_supports_the_cached:_true_option -# https://github.com/rails/rails/pull/48937 -Patch2: rubygem-actionview-7.0.7-Handle-non-string-partial-body-in-ActionView-CollectionCaching.patch BuildRequires: ruby(release) BuildRequires: rubygems-devel @@ -57,8 +52,6 @@ Documentation for %{name}. %prep %setup -q -n %{gem_name}-%{version}%{?prerelease} -b1 -b2 -%patch 2 -p2 - pushd %{_builddir} %patch 0 -p2 %patch 1 -p2 @@ -108,6 +101,9 @@ popd %doc %{gem_instdir}/CHANGELOG.md %changelog +* Sun Sep 10 2023 Pavel Valena - 7.0.8-1 +- Update to actionview 7.0.8. + * Wed Aug 30 2023 Vít Ondruch - 7.0.7.2-2 - Fix Jbuilder compatibility. diff --git a/sources b/sources index b1e670e..5127b43 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ -SHA512 (actionview-7.0.7.2.gem) = a063387f7da08cfb1d36464aa815afc904bac1a383a9a12a52b8ea3eecf89b7ae93d33bcff7a3410cd4db870eb17eaa03569d3ced4c65693019b03007cf03542 -SHA512 (actionview-7.0.7.2-tests.txz) = b53a5d0210c6448b50b4977aeb246173e93d8f34c786dbd2fdb9d420440554b1231716c866f81eb05dd8c8ab9349786eb968a1319aff9abcd2d6557792717948 -SHA512 (rails-7.0.7.2-tools.txz) = 409fe6374d785cfb5d8804fc5d993f53d2293891dbdd21c85af614f015c56d29c234716eed69862a71f758f62558582b61c8c4a07b56645e928dde57ef947080 +SHA512 (actionview-7.0.8.gem) = d29aef05ed701ee16c61a652d38fbcb844090c3f088dd4bcd00f7dc29f448289d5b6208b295e7de43efd795cc553f98c3c0f754bfaba0fc97feb9b56d8e13db2 +SHA512 (actionview-7.0.8-tests.txz) = dbcd6e4758b17d47045b0912b671aa0440df119c4278048a92a57a43f3f8202ecc49c0eb77836b40880bcd16b91e072721ef1ff74470221aeecb0e5596d307e4 +SHA512 (rails-7.0.8-tools.txz) = a67b43ecabe47d23bd437651c97c87e1323dc2eb20d0fffa2c8f0d75fae7502571c3a2633c5bdeb9cc4a383c88b5eade49d55efe895857285b3186b6d4da4b26