Commit 226be609a064dbb031a10f6b387f19525a63a83f

Authored by Victor Costa
1 parent eb3bd5ec

pairwise: change from lambda to proc

plugins/pairwise/lib/pairwise_plugin/pairwise_content.rb
@@ -59,7 +59,7 @@ class PairwisePlugin::PairwiseContent < Article @@ -59,7 +59,7 @@ class PairwisePlugin::PairwiseContent < Article
59 embeded = options.has_key? "embeded" 59 embeded = options.has_key? "embeded"
60 prompt_id = options["prompt_id"] 60 prompt_id = options["prompt_id"]
61 pairwise_content = self 61 pairwise_content = self
62 - lambda do 62 + proc do
63 locals = {:pairwise_content => pairwise_content, :source => source, :embeded => embeded, :prompt_id => prompt_id } 63 locals = {:pairwise_content => pairwise_content, :source => source, :embeded => embeded, :prompt_id => prompt_id }
64 render :file => 'content_viewer/prompt', :locals => locals 64 render :file => 'content_viewer/prompt', :locals => locals
65 end 65 end
plugins/pairwise/lib/pairwise_plugin/pairwise_question_block.rb
@@ -14,7 +14,7 @@ class PairwisePlugin::PairwiseQuestionBlock < Block @@ -14,7 +14,7 @@ class PairwisePlugin::PairwiseQuestionBlock < Block
14 14
15 def content(args={}) 15 def content(args={})
16 block = self 16 block = self
17 - lambda do 17 + proc do
18 pairwise_client = new PairwiseClient(owner.id) 18 pairwise_client = new PairwiseClient(owner.id)
19 question = pairwise_client.get_question(pairwise_question_id) 19 question = pairwise_client.get_question(pairwise_question_id)
20 if !question.blank? 20 if !question.blank?
@@ -29,4 +29,4 @@ class PairwisePlugin::PairwiseQuestionBlock < Block @@ -29,4 +29,4 @@ class PairwisePlugin::PairwiseQuestionBlock < Block
29 def cacheable? 29 def cacheable?
30 false 30 false
31 end 31 end
32 -end  
33 \ No newline at end of file 32 \ No newline at end of file
  33 +end
plugins/pairwise/lib/pairwise_plugin/questions_group_block.rb
@@ -12,7 +12,7 @@ class PairwisePlugin::QuestionsGroupBlock < Block @@ -12,7 +12,7 @@ class PairwisePlugin::QuestionsGroupBlock < Block
12 def content(args={}) 12 def content(args={})
13 block = self 13 block = self
14 question = pick_question 14 question = pick_question
15 - lambda do 15 + proc do
16 content = block_title(block.title) 16 content = block_title(block.title)
17 content += ( question ? article_to_html(question,:gallery_view => false, :format => 'full').html_safe : _('No Question selected yet.') ) 17 content += ( question ? article_to_html(question,:gallery_view => false, :format => 'full').html_safe : _('No Question selected yet.') )
18 end 18 end
plugins/pairwise/lib/pairwise_plugin/questions_group_list_block.rb
@@ -13,13 +13,13 @@ class PairwisePlugin::QuestionsGroupListBlock < Block @@ -13,13 +13,13 @@ class PairwisePlugin::QuestionsGroupListBlock < Block
13 def content(args={}) 13 def content(args={})
14 block = self 14 block = self
15 questions = questions.shuffle if(questions) 15 questions = questions.shuffle if(questions)
16 - #lambda do 16 + #proc do
17 # content = block_title(block.title) 17 # content = block_title(block.title)
18 # content += ( question ? article_to_html(question,:gallery_view => false, :format => 'full').html_safe : _('No Question selected yet.') ) 18 # content += ( question ? article_to_html(question,:gallery_view => false, :format => 'full').html_safe : _('No Question selected yet.') )
19 #end 19 #end
20 - lambda do  
21 - render :file => 'blocks/questions_group_list', :locals => {:block => block}  
22 - end 20 + proc do
  21 + render :file => 'blocks/questions_group_list', :locals => {:block => block}
  22 + end
23 end 23 end
24 24
25 def random_sort= value 25 def random_sort= value