Class: Dry::Rails::Features::ApplicationContract Abstract

Inherits:
Validation::Contract
  • Object
show all
Defined in:
lib/dry/rails/features/application_contract.rb

Overview

This class is abstract.

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.

Class Method Summary collapse

Class Method Details

.finalize!(railtie) ⇒ Class

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

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

Parameters:

Returns:

  • (Class)


26
27
28
29
30
31
32
33
34
# 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