Skip to content
Browse files

Ruby 1.8.6 workaround

  • Loading branch information...
1 parent 71b5bd2 commit 45f926569a0a5be71b21e84b08d508ceba45cce7 @ursm ursm committed
Showing with 2 additions and 1 deletion.
  1. +2 −1 abetterteam.rb
View
3 abetterteam.rb
@@ -3,6 +3,7 @@
require 'haml'
require 'yaml'
require 'base64'
+require 'enumerator'
helpers do
def load_quiz
@@ -64,7 +65,7 @@ def decode_param(str)
@result = decode_param(params["result"])
@quiz.each do |quiz|
- quiz["point"] = quiz["items"].each_with_index.inject(0) {|point, (item, index)|
+ quiz["point"] = quiz["items"].enum_for(:each_with_index).inject(0) {|point, (item, index)|
params_index = "#{quiz["category"]}#{index}"
point + item["#{@result[params_index]}_point"].to_i
}.to_s

0 comments on commit 45f9265

Please sign in to comment.
Something went wrong with that request. Please try again.