Commit a4458d702c41a5b609f56ed10e4076d9c84ba181
Committed by
Rodrigo Souto
1 parent
1cf37958
Exists in
master
and in
29 other branches
Use instance_eval instead of content.call on plugins' dispatch
ActionItem3098
Showing
2 changed files
with
6 additions
and
6 deletions
Show diff stats
app/views/layouts/application-ng.rhtml
| @@ -34,8 +34,8 @@ | @@ -34,8 +34,8 @@ | ||
| 34 | <%# Add custom tags/styles/etc via content_for %> | 34 | <%# Add custom tags/styles/etc via content_for %> |
| 35 | <%= yield :head %> | 35 | <%= yield :head %> |
| 36 | <%= | 36 | <%= |
| 37 | - @plugins.dispatch(:head_ending).collect do |content| | ||
| 38 | - content.respond_to?(:call) ? content.call : content | 37 | + @plugins.dispatch(:head_ending).map do |content| |
| 38 | + if content.respond_to?(:call) then instance_eval(&content).html_safe else content.html_safe end | ||
| 39 | end.join("\n") | 39 | end.join("\n") |
| 40 | %> | 40 | %> |
| 41 | 41 | ||
| @@ -47,8 +47,8 @@ | @@ -47,8 +47,8 @@ | ||
| 47 | <a href="#content" id="link-go-content"><span><%= _("Go to the content") %></span></a> | 47 | <a href="#content" id="link-go-content"><span><%= _("Go to the content") %></span></a> |
| 48 | 48 | ||
| 49 | <%= | 49 | <%= |
| 50 | - @plugins.dispatch(:body_beginning).collect do |content| | ||
| 51 | - content.respond_to?(:call) ? content.call : content | 50 | + @plugins.dispatch(:body_beginning).map do |content| |
| 51 | + if content.respond_to?(:call) then instance_eval(&content).html_safe else content.html_safe end | ||
| 52 | end.join("\n") | 52 | end.join("\n") |
| 53 | %> | 53 | %> |
| 54 | 54 |
app/views/profile_editor/edit.rhtml
| @@ -52,8 +52,8 @@ | @@ -52,8 +52,8 @@ | ||
| 52 | )%> | 52 | )%> |
| 53 | 53 | ||
| 54 | <%= | 54 | <%= |
| 55 | - @plugins.dispatch(:profile_editor_extras).each do |content| | ||
| 56 | - content.respond_to?(:call) ? content.call : content | 55 | + @plugins.dispatch(:profile_editor_extras).map do |content| |
| 56 | + if content.respond_to?(:call) then instance_eval(&content).html_safe else content.html_safe end | ||
| 57 | end.join("\n") | 57 | end.join("\n") |
| 58 | %> | 58 | %> |
| 59 | 59 |