dry-rb / dry-schema

Coercion and validation for data structures
https://dry-rb.org/gems/dry-schema
MIT License
425 stars 109 forks source link

Defining base schema class - error in documentation #336

Closed MatUrbanski closed 3 years ago

MatUrbanski commented 3 years ago

Defining base schema class documentation contains an example that is not working:

class AppSchema < Dry::Schema::Params
  config.messages.load_paths << '/my/app/config/locales/en.yml'
  config.messages.backend = :i18n

  define do
    # define common rules, if any
  end
end

When I try to use this example I get the following error:

NoMethodError: undefined method `messages' for #<Dry::Configurable::Config:0x00007ff27f0d83f0>
from /Users/mateuszurbanski/.gem/ruby/2.7.2/gems/dry-configurable-0.11.6/lib/dry/configurable/config.rb:106:in `method_missing'
solnic commented 3 years ago

Fixed via c53004f6ab018624526ac56e18ce28d8d291f1e0