Commit 18329cab550773199c14765d041eb2ff7e30539e
1 parent
18a8487d
Exists in
staging
and in
42 other branches
rails3: add mandatory argument to blocks passed to instance_eval
Showing
2 changed files
with
8 additions
and
3 deletions
Show diff stats
app/models/profile_image_block.rb
| @@ -15,8 +15,11 @@ class ProfileImageBlock < Block | @@ -15,8 +15,11 @@ class ProfileImageBlock < Block | ||
| 15 | def content(args={}) | 15 | def content(args={}) |
| 16 | block = self | 16 | block = self |
| 17 | s = show_name | 17 | s = show_name |
| 18 | - lambda do | ||
| 19 | - render :file => 'blocks/profile_image', :locals => { :block => block, :show_name => s} | 18 | + lambda do |object| |
| 19 | + render( | ||
| 20 | + :file => 'blocks/profile_image', | ||
| 21 | + :locals => { :block => block, :show_name => s } | ||
| 22 | + ) | ||
| 20 | end | 23 | end |
| 21 | end | 24 | end |
| 22 | 25 |
app/models/sellers_search_block.rb
| 1 | class SellersSearchBlock < Block | 1 | class SellersSearchBlock < Block |
| 2 | 2 | ||
| 3 | + attr_accessible :title | ||
| 4 | + | ||
| 3 | def self.description | 5 | def self.description |
| 4 | _('Search for enterprises and products') | 6 | _('Search for enterprises and products') |
| 5 | end | 7 | end |
| @@ -18,7 +20,7 @@ class SellersSearchBlock < Block | @@ -18,7 +20,7 @@ class SellersSearchBlock < Block | ||
| 18 | 20 | ||
| 19 | def content(args={}) | 21 | def content(args={}) |
| 20 | title = self.title | 22 | title = self.title |
| 21 | - lambda do | 23 | + lambda do |object| |
| 22 | render :file => 'search/_sellers_form', :locals => { :title => title } | 24 | render :file => 'search/_sellers_form', :locals => { :title => title } |
| 23 | end | 25 | end |
| 24 | end | 26 | end |