Commit fad353e417a6e7942fca970779a9267794f8daf2
1 parent
6639e83b
Exists in
master
and in
23 other branches
Passing only product to asset_product_extras hotspot
Showing
3 changed files
with
4 additions
and
4 deletions
Show diff stats
app/views/search/_product.rhtml
| 1 | -<% extra_content = @plugins.dispatch(:asset_product_extras, product, product.enterprise).collect { |content| instance_eval(&content) } %> | 1 | +<% extra_content = @plugins.dispatch(:asset_product_extras, product).collect { |content| instance_eval(&content) } %> |
| 2 | <% extra_properties = @plugins.dispatch(:asset_product_properties, product)%> | 2 | <% extra_properties = @plugins.dispatch(:asset_product_properties, product)%> |
| 3 | 3 | ||
| 4 | <li class="search-product-item"> | 4 | <li class="search-product-item"> |
lib/noosfero/plugin.rb
| @@ -161,7 +161,7 @@ class Noosfero::Plugin | @@ -161,7 +161,7 @@ class Noosfero::Plugin | ||
| 161 | 161 | ||
| 162 | # -> Adds content to products on asset list | 162 | # -> Adds content to products on asset list |
| 163 | # returns = lambda block that creates html code | 163 | # returns = lambda block that creates html code |
| 164 | - def asset_product_extras(product, enterprise) | 164 | + def asset_product_extras(product) |
| 165 | nil | 165 | nil |
| 166 | end | 166 | end |
| 167 | 167 |
test/functional/search_controller_test.rb
| @@ -227,13 +227,13 @@ class SearchControllerTest < ActionController::TestCase | @@ -227,13 +227,13 @@ class SearchControllerTest < ActionController::TestCase | ||
| 227 | 227 | ||
| 228 | should 'include extra content supplied by plugins on product asset' do | 228 | should 'include extra content supplied by plugins on product asset' do |
| 229 | class Plugin1 < Noosfero::Plugin | 229 | class Plugin1 < Noosfero::Plugin |
| 230 | - def asset_product_extras(product, enterprise) | 230 | + def asset_product_extras(product) |
| 231 | lambda {"<span id='plugin1'>This is Plugin1 speaking!</span>"} | 231 | lambda {"<span id='plugin1'>This is Plugin1 speaking!</span>"} |
| 232 | end | 232 | end |
| 233 | end | 233 | end |
| 234 | 234 | ||
| 235 | class Plugin2 < Noosfero::Plugin | 235 | class Plugin2 < Noosfero::Plugin |
| 236 | - def asset_product_extras(product, enterprise) | 236 | + def asset_product_extras(product) |
| 237 | lambda {"<span id='plugin2'>This is Plugin2 speaking!</span>"} | 237 | lambda {"<span id='plugin2'>This is Plugin2 speaking!</span>"} |
| 238 | end | 238 | end |
| 239 | end | 239 | end |