diff --git a/CHANGELOG.md b/CHANGELOG.md index ed9dbe5a4..fd7899ec4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # master +* Bypass monkey patch on Rails 6.1 builds. + + *Joel Hawksley* + * Make `ActionView::Helpers::TagHelper` available in Previews def with_html_content diff --git a/lib/view_component/render_monkey_patch.rb b/lib/view_component/render_monkey_patch.rb index e664ae45b..cb47a45c9 100644 --- a/lib/view_component/render_monkey_patch.rb +++ b/lib/view_component/render_monkey_patch.rb @@ -3,7 +3,7 @@ module ViewComponent module RenderMonkeyPatch # :nodoc: def render(options = {}, args = {}, &block) - if options.respond_to?(:render_in) + if options.respond_to?(:render_in) && Rails.version.to_f < 6.1 options.render_in(self, &block) elsif options.is_a?(Class) && options < ActionView::Component::Base ActiveSupport::Deprecation.warn( diff --git a/lib/view_component/rendering_monkey_patch.rb b/lib/view_component/rendering_monkey_patch.rb index 7a8bafbd4..eeb5163c3 100644 --- a/lib/view_component/rendering_monkey_patch.rb +++ b/lib/view_component/rendering_monkey_patch.rb @@ -3,7 +3,7 @@ module ViewComponent module RenderingMonkeyPatch # :nodoc: def render(options = {}, args = {}) - if options.respond_to?(:render_in) + if options.respond_to?(:render_in) && Rails.version.to_f < 6.1 self.response_body = options.render_in(self.view_context) else super