Skip to content

Commit 6ce4b4b

Browse files
committed
Cell::ViewModel#state_for_implicit_render is fixed for ruby 3.4.0
Ruby 3.4 has added to Kernel#caller the class and the method, e.g. Object#foo, before the method was only displayed.
1 parent 56ab217 commit 6ce4b4b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: lib/cell/view_model.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ def process_options!(options)
199199
# Computes the view name from the call stack in which `render` was invoked.
200200
def state_for_implicit_render(options)
201201
_caller = RUBY_VERSION < "2.0" ? caller(3) : caller(3, 1) # TODO: remove case in 5.0 when dropping 1.9.
202-
_caller[0].match(/`(\w+)/)[1]
202+
_caller[0].match(/`(\w+)|#(\w+)'/).captures.compact.first
203203
end
204204

205205
include Layout

0 commit comments

Comments
 (0)