Commit c29b0edcceda74fd789045db1ec81ef64de16b33
Committed by
Antonio Terceiro
1 parent
1a2951af
Exists in
master
and in
21 other branches
shopping-cart-plugin: instance_exec instead of instance_eval
AI3286
Showing
3 changed files
with
5 additions
and
5 deletions
Show diff stats
app/views/catalog/index.html.erb
| @@ -14,8 +14,8 @@ | @@ -14,8 +14,8 @@ | ||
| 14 | 14 | ||
| 15 | <ul id="product-list"> | 15 | <ul id="product-list"> |
| 16 | <% @products.each do |product| %> | 16 | <% @products.each do |product| %> |
| 17 | - <% extra_content = @plugins.dispatch(:catalog_item_extras, product).collect { |content| instance_eval(&content) } %> | ||
| 18 | - <% extra_content_list = @plugins.dispatch(:catalog_list_item_extras, product).collect { |content| instance_eval(&content) } %> | 17 | + <% extra_content = @plugins.dispatch(:catalog_item_extras, product).collect { |content| instance_exec(&content) } %> |
| 18 | + <% extra_content_list = @plugins.dispatch(:catalog_list_item_extras, product).collect { |content| instance_exec(&content) } %> | ||
| 19 | 19 | ||
| 20 | <% status = [] %> | 20 | <% status = [] %> |
| 21 | <% status << 'not-available' if !product.available %> | 21 | <% status << 'not-available' if !product.available %> |
app/views/manage_products/show.html.erb
| @@ -13,7 +13,7 @@ | @@ -13,7 +13,7 @@ | ||
| 13 | <%= render :partial => 'manage_products/display_image' %> | 13 | <%= render :partial => 'manage_products/display_image' %> |
| 14 | </div> | 14 | </div> |
| 15 | <div id='product-extra-content'> | 15 | <div id='product-extra-content'> |
| 16 | - <% extra_content = @plugins.dispatch(:product_info_extras, @product).collect { |content| instance_eval(&content) } %> | 16 | + <% extra_content = @plugins.dispatch(:product_info_extras, @product).collect { |content| instance_exec(&content) } %> |
| 17 | <%= extra_content.join("\n") %> | 17 | <%= extra_content.join("\n") %> |
| 18 | </div> | 18 | </div> |
| 19 | <div id='product-info'> | 19 | <div id='product-info'> |
lib/noosfero/plugin.rb
| @@ -239,7 +239,7 @@ class Noosfero::Plugin | @@ -239,7 +239,7 @@ class Noosfero::Plugin | ||
| 239 | nil | 239 | nil |
| 240 | end | 240 | end |
| 241 | 241 | ||
| 242 | - # -> Adds content to calalog item | 242 | + # -> Adds content to catalog item |
| 243 | # returns = lambda block that creates html code | 243 | # returns = lambda block that creates html code |
| 244 | def catalog_item_extras(item) | 244 | def catalog_item_extras(item) |
| 245 | nil | 245 | nil |
| @@ -251,7 +251,7 @@ class Noosfero::Plugin | @@ -251,7 +251,7 @@ class Noosfero::Plugin | ||
| 251 | nil | 251 | nil |
| 252 | end | 252 | end |
| 253 | 253 | ||
| 254 | - # -> Adds content to calalog list item | 254 | + # -> Adds content to catalog list item |
| 255 | # returns = lambda block that creates html code | 255 | # returns = lambda block that creates html code |
| 256 | def catalog_list_item_extras(item) | 256 | def catalog_list_item_extras(item) |
| 257 | nil | 257 | nil |