dry-rb / dry-rails

The official dry-rb railtie
https://dry-rb.org/gems/dry-rails
MIT License
270 stars 27 forks source link

Define default_namespace automatically #13

Closed solnic closed 4 years ago

solnic commented 4 years ago

This sets config.default_namespace automatically to the lower-cased application constant. ie if your application namespace is MyApp then it will be set to "my_app". This setting allows you to omit the namespace when using import module ie:

class Notifier
  # instead of this
  include Import["my_app.mailer"]

  # you can do this
  include Import[:mailer]
end