I’m using jruby-1.5.3 with a rails 2.3.5 app. I’ve just started playing around with thread safety using:
config.threadsafe!
config.eager_load_paths << "#{RAILS_ROOT}/lib"
Which works fine, I just noticed however on deployment to my staging environment (which has the same config as production) that I get undefined constants. For instance, a migration that adds another role to a Role table:
class AddSuperAdminRole < ActiveRecord::Migration
def self.up
Role.create :rolename => 'super_admin'
end
end
throws a:
uninitialized constant AddSuperAdminRole::Role
It works fine in dev environment because i’m not running that multithreaded so I know that’s the issue. I’ve tried eager loading the app/models path also but that didn’t work. How do I get migrations running with threadsafety?
upgrading to 2.3.10 fixed this.