rubygem-sprockets-rails/Fix-extending-ActionView-Base-instances.patch

29 lines
876 B
Diff

From 66fd4ab6f2bd7b8e6a34331460fe2e8dc46143d7 Mon Sep 17 00:00:00 2001
From: Andrew White <andrew.white@unboxed.co>
Date: Sat, 12 Sep 2020 06:50:53 +0100
Subject: [PATCH] Fix extending ActionView::Base instances
In rails/rails@1165401 the Active Support core extension for
Kernel#class_eval was removed so we need to call it on the
singleton_klass ourselves.
---
lib/sprockets/rails/helper.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/sprockets/rails/helper.rb b/lib/sprockets/rails/helper.rb
index 20cc4d3..ee7c5f3 100644
--- a/lib/sprockets/rails/helper.rb
+++ b/lib/sprockets/rails/helper.rb
@@ -58,7 +58,7 @@ module Sprockets
end
def self.extended(obj)
- obj.class_eval do
+ obj.singleton_class.class_eval do
attr_accessor(*VIEW_ACCESSORS)
remove_method :assets_environment
--
2.33.0