Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding app/views to autoload_paths causes NameError #54

Open
longlostnick opened this issue May 27, 2015 · 0 comments
Open

Adding app/views to autoload_paths causes NameError #54

longlostnick opened this issue May 27, 2015 · 0 comments

Comments

@longlostnick
Copy link

https://github.com/agoragames/stache/blob/master/lib/stache/railtie.rb#L3-L5

A lot of view paths/filenames are similar to models, so I think this is confusing ActiveSupport load_missing_constant.

This is actually causing a NameError in a controller in one of my apps:

NameError - uninitialized constant CheckoutController::Checkout:
  activesupport (4.0.1) lib/active_support/dependencies.rb:501:in `load_missing_constant'
  activesupport (4.0.1) lib/active_support/dependencies.rb:184:in `const_missing'
  app/controllers/public/checkout_controller.rb:102:in `create'
  actionpack (4.0.1) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
  actionpack (4.0.1) lib/abstract_controller/base.rb:189:in `process_action'
  actionpack (4.0.1) lib/action_controller/metal/rendering.rb:10:in `process_action'
  actionpack (4.0.1) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
  activesupport (4.0.1) lib/active_support/callbacks.rb:464:in `block in _run__3470950773892421648__process_action__callbacks'
  activesupport (4.0.1) lib/active_support/callbacks.rb:212:in `block in _conditional_callback_around_34'

For now I've just forked the repo and removed those lines, and everything works great again: longlostnick@dfac23a

I can make a fix/change if one needs to be made, but wanted to present the issue for discussion first. The easiest thing to do is remove those lines from the Railtie, but I'm guessing those are in there for a reason!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant