lib/deface/action_view_extensions.rb in deface-1.3.2 vs lib/deface/action_view_extensions.rb in deface-1.4.0

- old
+ new

@@ -4,20 +4,20 @@ def initialize(source, identifier, handler, details) syntax = determine_syntax(handler) if Rails.application.config.deface.enabled && should_be_defaced?(syntax) - processed_source = Deface::Override.apply(source, details, true, syntax) + processed_source = Deface::Override.apply(source.to_param, details, true, syntax) # force change in handler before continuing to original Rails method # as we've just converted some other template language into ERB! # - if [:slim, :haml].include?(syntax) && processed_source != source + if [:slim, :haml].include?(syntax) && processed_source != source.to_param handler = ActionView::Template::Handlers::ERB end else - processed_source = source + processed_source = source.to_param end initialize_without_deface(processed_source, identifier, handler, details) end @@ -26,11 +26,11 @@ # refresh view to get source again if # view needs to be recompiled # def render(view, locals, buffer=nil, &block) - if view.is_a?(ActionView::CompiledTemplates) - mod = ActionView::CompiledTemplates + if view.is_a?(ActionView::Base) + mod = ActionView::Base else mod = view.singleton_class end if @compiled && !mod.instance_methods.map(&:to_s).include?(method_name)