Created
March 20, 2015 09:42
-
-
Save KevinFerm/918787e1fa00895b54c1 to your computer and use it in GitHub Desktop.
Bad function
This file contains hidden or 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
helper_method :get_completion | |
def get_completion(user) | |
if user.name | |
done = {} | |
comp = JSON.parse(user.completion) | |
if comp.length > 0 | |
comp.each do |catkey,catval| | |
if catkey | |
done[catkey] = {} | |
if catval | |
catval.each do |stepkey,stepval| | |
done[catkey][stepkey] = stepval | |
end | |
end | |
end | |
end | |
return done | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment