module CmAdmin::Utils
def recursive_hash
def recursive_hash func = ->(h, k) { h[k] = Hash.new(&func) } # This hash creates a new hash, infinitely deep, whenever a value is not found # recursive_hash[:a][:b][:c][:d] will never fail Hash.new(&func) end