lib/deface/action_view_extensions.rb in deface-1.5.0 vs lib/deface/action_view_extensions.rb in deface-1.5.1
- old
+ new
@@ -26,12 +26,12 @@
# refresh view to get source again if
# view needs to be recompiled
#
def render(view, locals, buffer=nil, &block)
- if Rails.version < "6.0.0.beta1" && view.is_a?(ActionView::CompiledTemplates)
+ if Gem.loaded_specs["rails"].version < Gem::Version.new("6.0.0.beta1") && view.is_a?(ActionView::CompiledTemplates)
mod = ActionView::CompiledTemplates
- elsif Rails.version >= "6.0.0.beta1" && view.is_a?(ActionDispatch::DebugView)
+ elsif Gem.loaded_specs["rails"].version >= Gem::Version.new("6.0.0.beta1") && view.is_a?(ActionDispatch::DebugView)
mod = ActionDispatch::DebugView
else
mod = view.singleton_class
end