-
-
Save eagleas/7090388dd34b2dc6f54d7c551826241d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if depend_options[question[:id]] | |
hash.delete_if { |k, v| !depend_options[question[:id]].include?(k) } | |
depend_options[question[:id]].sum{ |opt_id| (hash[opt_id] || 0) } | |
else | |
s1 = hash.reject { |k, v| | |
res = cnt_replies_by_question.keys.include?(k) | |
puts Anketa::Question.find(k).skey if !res | |
res | |
}.values.max || 0 | |
puts "+++ #{s1}" if s1 > 0 | |
s2 = hash.select {|k, v| cnt_replies_by_question.keys.include?(k) }.values.max || 0 | |
puts "---" if s2 > 0 | |
s1 + s2 | |
#hash.values.max || 0 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment