Skip to content

Instantly share code, notes, and snippets.

@rivanenko
Created October 9, 2013 11:16
@svc.before do
  recursively_unpermit_hash(params)
end

def recursively_unpermit_hash(h)
  h.define_singleton_method(:permitted?) { false }
  h.each { |_, v| recursively_unpermit_hash(v) if v.is_a?(Hash) }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment