Sha256: e13858e70a372c5a86621dd25c39888ebb45a5e4e4fb7522403b2b983d5b114b

Contents?: true

Size: 530 Bytes

Versions: 1

Compression:

Stored size: 530 Bytes

Contents

# frozen_string_literal: true

module SnakeEyes
  module Compatibility
    if Rails::VERSION::MAJOR >= 5
      def _prepare(transformed_params)
        # We permit all parameter values so that we many convert it to a hash,
        # to work with ActionPack 5.2's ActionController::Parameters initializer
        params_duplicate = transformed_params.dup
        params_duplicate.permit!
        params_duplicate.to_h
      end
    else
      def _prepare(transformed_params)
        transformed_params
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
snake-eyes-2.0.0 lib/snake_eyes/compatibility.rb