diff --git a/lib/thredded.rb b/lib/thredded.rb
index <HASH>..<HASH> 100644
--- a/lib/thredded.rb
+++ b/lib/thredded.rb
@@ -29,6 +29,7 @@ require 'select2-rails'
 require 'sprockets/es6'
 
 require 'thredded/engine'
+require_dependency 'thredded/errors'
 
 module Thredded
   mattr_accessor \
diff --git a/lib/thredded/engine.rb b/lib/thredded/engine.rb
index <HASH>..<HASH> 100644
--- a/lib/thredded/engine.rb
+++ b/lib/thredded/engine.rb
@@ -3,9 +3,11 @@ module Thredded
   class Engine < ::Rails::Engine
     isolate_namespace Thredded
 
-    %w(app/view_hooks app/view_models app/forms app/commands app/jobs lib).each do |path|
-      config.autoload_paths << File.expand_path("../../#{path}", File.dirname(__FILE__))
-    end
+    # All of the paths Thredded needs are already in the default Rails paths.
+    # However, the lib paths is not autoloaded by default. Make it *autoload* to make developing Thredded easier.
+    # Do not *eager_load* because not all the code in lib should be loaded in production.
+    # The code in lib that should be loaded in production is required explicitly via `require_dependency`.
+    config.paths['lib'].autoload!
 
     config.generators do |g|
       g.test_framework :rspec, fixture: true
Remove config.autoload_paths that are default

All of our config.autoload_paths are already Rails defaults for an
Engine, so we don't need to set them. We only need to set `lib` to
autoload.

Also, add a missing `require_dependency` for `thredded/errors`,
so that it's eager-loaded in production.

This also happens to improve compatibility with rails_admin's magic.
See #<I> on why.