I have two models: User and Manager. I use STI to inherit `Manager`
from `User` model.
class User < ActiveRecord::Base
class Manager < User
I have added the models in the custom directory to load path as
config.autoload_path += File.join(RAILS_ROOT, "custom_lib", "models")
Every thing works as expected in development mode. In the production
mode I get the following error:
The single-table inheritance mechanism failed to locate the subclass:
For some reason rails is not loading the inherited classes.
To work around this issue I explicitly require the classes in an
Dir[File.join(RAILS_ROOT, "custom_lib", "models", "*.rb")].each do |
I prefer to use autoload_path. I am wondering if anybody can explain
the reason for this behavior and any possible fix.
I am on Ruby 1.8.7, Rails 2.3.9, Ubuntu