Skip to content

Commit

Permalink
moved lib/ under app/ to make it findable by eager loader; fixed eage…
Browse files Browse the repository at this point in the history
…r loading annotations in config files
  • Loading branch information
armandofox committed Sep 27, 2024
1 parent ee6b411 commit 0a99e5f
Show file tree
Hide file tree
Showing 29 changed files with 2 additions and 14 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 1 addition & 13 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,10 @@ class Application < Rails::Application
config.active_record.default_timezone = :local

# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = 'en'

config.autoload_paths << Rails.root.join('lib')

config.assets.enabled = true

# Add additional load paths for your own custom dirs
additional_paths = Dir.glob(File.join Rails.root, "app/models/**/*").select { |f| File.directory? f }
config.eager_load_paths += additional_paths
# for autoload, also include stuff in services/, but don't eager-load that since it
# references autoloadable stuff and gives the weird 'has been removed from the module tree
# but is still active' error
additional_paths += Dir.glob(File.join Rails.root, "app/services/**/*").select { |f| File.directory? f }
config.autoload_paths += additional_paths

config.eager_load = true

config.after_initialize do
config.action_mailer.delivery_method = :smtp
Expand Down
2 changes: 1 addition & 1 deletion config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
config.cache_classes = false

# Do not eager load code on boot.
config.eager_load = false
#config.eager_load = false

# Log error messages when you accidentally call methods on nil.
config.whiny_nils = true
Expand Down

0 comments on commit 0a99e5f

Please sign in to comment.