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 | 14 | |
| 15 | 15 | <ul id="product-list"> |
| 16 | 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 | 20 | <% status = [] %> |
| 21 | 21 | <% status << 'not-available' if !product.available %> | ... | ... |
app/views/manage_products/show.html.erb
| ... | ... | @@ -13,7 +13,7 @@ |
| 13 | 13 | <%= render :partial => 'manage_products/display_image' %> |
| 14 | 14 | </div> |
| 15 | 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 | 17 | <%= extra_content.join("\n") %> |
| 18 | 18 | </div> |
| 19 | 19 | <div id='product-info'> | ... | ... |
lib/noosfero/plugin.rb
| ... | ... | @@ -239,7 +239,7 @@ class Noosfero::Plugin |
| 239 | 239 | nil |
| 240 | 240 | end |
| 241 | 241 | |
| 242 | - # -> Adds content to calalog item | |
| 242 | + # -> Adds content to catalog item | |
| 243 | 243 | # returns = lambda block that creates html code |
| 244 | 244 | def catalog_item_extras(item) |
| 245 | 245 | nil |
| ... | ... | @@ -251,7 +251,7 @@ class Noosfero::Plugin |
| 251 | 251 | nil |
| 252 | 252 | end |
| 253 | 253 | |
| 254 | - # -> Adds content to calalog list item | |
| 254 | + # -> Adds content to catalog list item | |
| 255 | 255 | # returns = lambda block that creates html code |
| 256 | 256 | def catalog_list_item_extras(item) |
| 257 | 257 | nil | ... | ... |