class Dry::Rails::Features::ApplicationContract

Abstract application contract class used by the `:application_contract` feature

This is an abstract class that's pre-configured during booting process to serve as the base class that the ApplicationContract class inherits from.

@see dry-rb.org/gems/dry-validation/1.5/configuration/

@abstract

@api public

Public Class Methods

finalize!(railtie) click to toggle source

This is called during the booting process of the `:application_contract` feature

@param railtie [Dry::Rails::Railtie]

@return [Class]

@api private

# File lib/dry/rails/features/application_contract.rb, line 26
def self.finalize!(railtie)
  load_paths = Dir[railtie.container.root.join("config/locales/*.yml")]

  config.messages.top_namespace = :contracts
  config.messages.backend = :i18n
  config.messages.load_paths += load_paths

  self
end