puffer/puffer — Issue #15: Uninitialized constant ActiveRecord when running in production
Author: adie
Created: 2011-10-13 18:45:23+00:00
State: open

Trying to use puffer with MongoDB without any ActiveRecord models, thus I don't load ActiveRecord at all.
I've created custom User model, overrided `current_puffer_user` and `has_puffer_access?` methods.
In development environment everything works great. But when I try to run the app in the production env, I'm getting this:

```
vendor/ruby/1.9.1/bundler/gems/puffer-b3016bfffcef/app/models/puffer/puffer_user.rb:1:in `': uninitialized constant ActiveRecord (NameError)
from vendor/ruby/1.9.1/bundler/gems/puffer-b3016bfffcef/app/models/puffer_user.rb:1:in `'
from vendor/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/inflector/methods.rb:124:in `block in constantize'
from vendor/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/inflector/methods.rb:123:in `each'
from vendor/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/inflector/methods.rb:123:in `constantize'
from vendor/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/core_ext/string/inflections.rb:43:in `constantize'
from vendor/ruby/1.9.1/gems/actionpack-3.1.1/lib/action_controller/metal/params_wrapper.rb:148:in `_default_wrap_model'
from vendor/ruby/1.9.1/gems/actionpack-3.1.1/lib/action_controller/metal/params_wrapper.rb:167:in `_set_wrapper_defaults'
from vendor/ruby/1.9.1/gems/actionpack-3.1.1/lib/action_controller/metal/params_wrapper.rb:128:in `inherited'
from vendor/ruby/1.9.1/gems/actionpack-3.1.1/lib/abstract_controller/railties/routes_helpers.rb:7:in `block (2 levels) in with'
from vendor/ruby/1.9.1/gems/actionpack-3.1.1/lib/action_controller/railties/paths.rb:7:in `block (2 levels) in with'
from vendor/ruby/1.9.1/bundler/gems/puffer-b3016bfffcef/lib/puffer/controller/dsl.rb:29:in `inherited'
from vendor/ruby/1.9.1/bundler/gems/puffer-b3016bfffcef/app/controllers/admin/puffer_users_controller.rb:1:in `'
from vendor/ruby/1.9.1/gems/railties-3.1.1/lib/rails/engine.rb:417:in `block (2 levels) in eager_load!'
from vendor/ruby/1.9.1/gems/railties-3.1.1/lib/rails/engine.rb:416:in `each'
from vendor/ruby/1.9.1/gems/railties-3.1.1/lib/rails/engine.rb:416:in `block in eager_load!'
from vendor/ruby/1.9.1/gems/railties-3.1.1/lib/rails/engine.rb:414:in `each'
from vendor/ruby/1.9.1/gems/railties-3.1.1/lib/rails/engine.rb:414:in `eager_load!'
from vendor/ruby/1.9.1/gems/railties-3.1.1/lib/rails/application/railties.rb:8:in `each'
from vendor/ruby/1.9.1/gems/railties-3.1.1/lib/rails/application/railties.rb:8:in `all'
from vendor/ruby/1.9.1/gems/railties-3.1.1/lib/rails/engine.rb:412:in `eager_load!'
from vendor/ruby/1.9.1/gems/railties-3.1.1/lib/rails/application/finisher.rb:51:in `block in '
from vendor/ruby/1.9.1/gems/railties-3.1.1/lib/rails/initializable.rb:30:in `instance_exec'
from vendor/ruby/1.9.1/gems/railties-3.1.1/lib/rails/initializable.rb:30:in `run'
from vendor/ruby/1.9.1/gems/railties-3.1.1/lib/rails/initializable.rb:55:in `block in run_initializers'
from vendor/ruby/1.9.1/gems/railties-3.1.1/lib/rails/initializable.rb:54:in `each'
from vendor/ruby/1.9.1/gems/railties-3.1.1/lib/rails/initializable.rb:54:in `run_initializers'
from vendor/ruby/1.9.1/gems/railties-3.1.1/lib/rails/application.rb:96:in `initialize!'
from vendor/ruby/1.9.1/gems/railties-3.1.1/lib/rails/railtie/configurable.rb:30:in `method_missing'
from config/environment.rb:5:in `'
from config.ru:4:in `block in

'
from vendor/ruby/1.9.1/gems/rack-1.3.3/lib/rack/builder.rb:51:in `instance_eval'
from vendor/ruby/1.9.1/gems/rack-1.3.3/lib/rack/builder.rb:51:in `initialize'
from config.ru:1:in `new'
from config.ru:1:in `

'
from vendor/ruby/1.9.1/gems/rack-1.3.3/lib/rack/builder.rb:40:in `eval'
from vendor/ruby/1.9.1/gems/rack-1.3.3/lib/rack/builder.rb:40:in `parse_file'
from vendor/ruby/1.9.1/gems/rack-1.3.3/lib/rack/server.rb:200:in `app'
from vendor/ruby/1.9.1/gems/railties-3.1.1/lib/rails/commands/server.rb:46:in `app'
from vendor/ruby/1.9.1/gems/rack-1.3.3/lib/rack/server.rb:301:in `wrapped_app'
from vendor/ruby/1.9.1/gems/rack-1.3.3/lib/rack/server.rb:252:in `start'
from vendor/ruby/1.9.1/gems/railties-3.1.1/lib/rails/commands/server.rb:70:in `start'
from vendor/ruby/1.9.1/gems/railties-3.1.1/lib/rails/commands.rb:54:in `block in '
from vendor/ruby/1.9.1/gems/railties-3.1.1/lib/rails/commands.rb:49:in `tap'
from vendor/ruby/1.9.1/gems/railties-3.1.1/lib/rails/commands.rb:49:in `'
from script/rails:6:in `require'
from script/rails:6:in `

'
```