class Rails::Application
def self.add_lib_to_load_path!(root) #:nodoc:
you need to load files in lib/ during the application configuration as well.
Rails application, you will need to add lib to $LOAD_PATH on your own in case
are changing config.root inside your application definition or having a custom
Notice this method takes into consideration the default root path. So if you
end
config.i18n.backend = MyBackend
require "my_backend" # in lib/my_backend
class MyApplication < Rails::Application
configuration.
allowing the developer to load classes in lib and use them during application
This method is called just after an application inherits from Rails::Application,
def self.add_lib_to_load_path!(root) #:nodoc: path = File.join root, 'lib' if File.exist?(path) && !$LOAD_PATH.include?(path) $LOAD_PATH.unshift(path) end end