Sha256: b549a15a59c677c655bdf262ca39c100b78a47771b52e2f8fa3947d34a5e0ffe

Contents?: true

Size: 460 Bytes

Versions: 5

Compression:

Stored size: 460 Bytes

Contents

module Taro::Rails::ParamParsing
  def self.install(controller_class:, action_name:)
    return unless Taro.config.parse_params

    key = [controller_class, action_name]
    return if installed[key]

    installed[key] = true

    controller_class.before_action(only: action_name) do
      declaration = Taro::Rails.declaration_for(self)
      @api_params = declaration.parse_params(params)
    end
  end

  def self.installed
    @installed ||= {}
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
taro-1.4.0 lib/taro/rails/param_parsing.rb
taro-1.3.0 lib/taro/rails/param_parsing.rb
taro-1.2.0 lib/taro/rails/param_parsing.rb
taro-1.1.0 lib/taro/rails/param_parsing.rb
taro-1.0.0 lib/taro/rails/param_parsing.rb