From 356ed1a35203e1fabc2e1762759c28090de75c15 Mon Sep 17 00:00:00 2001 From: Victor Costa Date: Mon, 27 Apr 2015 17:57:35 -0300 Subject: [PATCH] Fix inclusion of javascript files from plugins --- app/helpers/layout_helper.rb | 2 +- test/unit/layout_helper_test.rb | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/app/helpers/layout_helper.rb b/app/helpers/layout_helper.rb index 7fd0def..e78aa11 100644 --- a/app/helpers/layout_helper.rb +++ b/app/helpers/layout_helper.rb @@ -28,7 +28,7 @@ module LayoutHelper end def noosfero_javascript - plugins_javascripts = @plugins.flat_map{ |plugin| plugin.js_files.map{ |js| plugin.class.public_path(js, true) } }.flatten + plugins_javascripts = @plugins.flat_map{ |plugin| Array.wrap(plugin.js_files).map{ |js| plugin.class.public_path(js, true) } }.flatten output = '' output += render 'layouts/javascript' diff --git a/test/unit/layout_helper_test.rb b/test/unit/layout_helper_test.rb index 3e38946..6286c1d 100644 --- a/test/unit/layout_helper_test.rb +++ b/test/unit/layout_helper_test.rb @@ -30,4 +30,17 @@ class LayoutHelperTest < ActionView::TestCase assert_match /