Module: TypeSpecFromSerializers::ResourcesPatch

Defined in:
lib/typespec_from_serializers/dsl/routing.rb

Overview

Internal: Patches ActionDispatch::Routing::Mapper::Resources to intercept resources method.

Intercepts the resources/resource DSL methods to support type: parameter.

Instance Method Summary collapse

Instance Method Details

#resources(*resources, &block) ⇒ Object



62
63
64
65
66
67
68
# File 'lib/typespec_from_serializers/dsl/routing.rb', line 62

def resources(*resources, &block)
  options = resources.extract_options!
  RoutingPatchHelpers.move_type_to_defaults!(options)

  resources.push(options) unless options.empty?
  super(*resources, &block)
end