Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Bad function
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
You can’t perform that action at this time.