Sha256: c0ce0491111efdff640f9b97c5be7d4e1c29c688e60969f95c74f9c069017f32

Contents?: true

Size: 380 Bytes

Versions: 1

Compression:

Stored size: 380 Bytes

Contents

# frozen_string_literal: true

module Granite
  module Form
    module Types
      class HashWithActionControllerParameters < Object
        private

        def typecast(value)
          case value
          when ActionController::Parameters
            value.to_h if value.permitted?
          when ::Hash
            value
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
granite-form-0.6.0 lib/granite/form/types/hash_with_action_controller_parameters.rb