[PATCH conductor] Fix mustache template handler to work with Rails 3.1 and above

Jason Guiditta jguiditt at redhat.com
Thu May 24 20:36:01 UTC 2012


On 24/05/12 16:24 +0200, ifarkas at redhat.com wrote:
>From: Imre Farkas <ifarkas at redhat.com>
>
>---
> .../initializers/mustache_template_handler.rb      |    8 +++++++-
> 1 files changed, 7 insertions(+), 1 deletions(-)
>
>diff --git a/src/config/initializers/mustache_template_handler.rb b/src/config/initializers/mustache_template_handler.rb
>index b6c6fbc..1fc6d1b 100644
>--- a/src/config/initializers/mustache_template_handler.rb
>+++ b/src/config/initializers/mustache_template_handler.rb
>@@ -18,7 +18,13 @@ module MustacheTemplate
>     end
>
>     def render
>-      renderer = @view_context.instance_variable_get('@renderer') if @view_context.instance_variable_names.include?('@renderer')
>+      renderer =
>+        if Rails.version >= '3.1'
>+          @view_context.instance_variable_get('@view_renderer').instance_variable_get('@_partial_renderer')
>+        else
>+          @view_context.instance_variable_get('@renderer') if @view_context.instance_variable_names.include?('@renderer')
>+        end
>+
>       options = renderer.instance_variable_get("@options") if renderer
>
>       if options && options.include?(:mustache)
>-- 
>1.7.6.5
>
ACK and pushed, thanks for the quick fix!  This get us down to 7
failing cukes on rails 3.2 (and all still pass on 3.0.x)!

-j



More information about the aeolus-devel mailing list