From b8748659f30694da811de2a6a16997ec97646f40 Mon Sep 17 00:00:00 2001 From: demonodojo Date: Thu, 18 Feb 2016 17:33:47 +0100 Subject: [PATCH] Problem with Rails 4.1.14.1 and 4.2.5 Avoids https://github.com/tscolari/mobylette/issues/49, https://github.com/tscolari/mobylette/issues/46, and https://github.com/tscolari/mobylette/issues/44 --- lib/mobylette/resolvers/chained_fallback_resolver.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/mobylette/resolvers/chained_fallback_resolver.rb b/lib/mobylette/resolvers/chained_fallback_resolver.rb index 24cca05..6a6cfdf 100644 --- a/lib/mobylette/resolvers/chained_fallback_resolver.rb +++ b/lib/mobylette/resolvers/chained_fallback_resolver.rb @@ -1,3 +1,6 @@ +require 'action_view' +require 'action_view/template/resolver' + module Mobylette module Resolvers class ChainedFallbackResolver < ::ActionView::FileSystemResolver @@ -39,13 +42,13 @@ def replace_fallback_formats_chain(formats) # Private: finds the right template on the filesystem, # using fallback if needed # - def find_templates(name, prefix, partial, details) + def find_templates(name, prefix, partial, details, other=false) # checks if the format has a fallback chain if @fallback_formats.has_key?(details[:formats].first) details = details.dup details[:formats] = Array.wrap(@fallback_formats[details[:formats].first]) end - super(name, prefix, partial, details) + super(name, prefix, partial, details,other) end # Helper for building query glob string based on resolver's pattern.