Sha256: 2ff4013b3e6621ed7c36791d5bed27191cdb29466fd6e54b38b75404babc8a70

Contents?: true

Size: 333 Bytes

Versions: 10

Compression:

Stored size: 333 Bytes

Contents

# frozen_string_literal: true

module MiniDefender::ValidatesInput
  extend ActiveSupport::Concern

  def validate!(rules, coerced = false)
    data = params.to_unsafe_hash.deep_stringify_keys
    validator = MiniDefender::Validator.new(rules, data)
    validator.validate!
    coerced ? validator.coerced : validator.data
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
mini_defender-0.2.0 lib/mini_defender/validates_input.rb
mini_defender-0.1.10 lib/mini_defender/validates_input.rb
mini_defender-0.1.9 lib/mini_defender/validates_input.rb
mini_defender-0.1.8 lib/mini_defender/validates_input.rb
mini_defender-0.1.6 lib/mini_defender/validates_input.rb
mini_defender-0.1.4 lib/mini_defender/validates_input.rb
mini_defender-0.1.3 lib/mini_defender/validates_input.rb
mini_defender-0.1.2 lib/mini_defender/validates_input.rb
mini_defender-0.1.1 lib/mini_defender/validates_input.rb
mini_defender-0.1.0 lib/mini_defender/validates_input.rb