Skip to content

Instantly share code, notes, and snippets.

@anamba
Created November 9, 2018 05:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anamba/22de14a570d8b7a4cf700eea16fd515b to your computer and use it in GitHub Desktop.
Save anamba/22de14a570d8b7a4cf700eea16fd515b to your computer and use it in GitHub Desktop.
added Amber::Validators::Params#to_unsafe_h
module Amber::Validators
class Params
def to_unsafe_h
unsafe_params = {} of String => String?
@rules.each do |rule|
rule.apply(raw_params)
unsafe_params[rule.field] = rule.value
end
unsafe_params
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment