Skip to content

Commit

Permalink
Remove compat for fragment_name_with_digest
Browse files Browse the repository at this point in the history
jbuilder only support Rails 5.0+ which responds to `cache_fragment_name`
  • Loading branch information
aried3r committed Oct 11, 2021
1 parent 9936b3b commit 062b1cf
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 6 deletions.
5 changes: 0 additions & 5 deletions lib/jbuilder/jbuilder_template.rb
Expand Up @@ -162,12 +162,7 @@ def _cache_key(key, options)

def _fragment_name_with_digest(key, options)
if @context.respond_to?(:cache_fragment_name)
# Current compatibility, fragment_name_with_digest is private again and cache_fragment_name
# should be used instead.
@context.cache_fragment_name(key, **options)
elsif @context.respond_to?(:fragment_name_with_digest)
# Backwards compatibility for period of time when fragment_name_with_digest was made public.
@context.fragment_name_with_digest(key)
else
key
end
Expand Down
1 change: 0 additions & 1 deletion test/test_helper.rb
Expand Up @@ -30,5 +30,4 @@ class Racer < Struct.new(:id, :name)

ActionView::Template.register_template_handler :jbuilder, JbuilderHandler

ActionView::Base.remove_possible_method :fragment_name_with_digest
ActionView::Base.remove_possible_method :cache_fragment_name

0 comments on commit 062b1cf

Please sign in to comment.