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

Already on GitHub? Sign in to your account

Namespaced controllers and Object is not missing constants XXX exception #530

wants to merge 4 commits into


None yet
5 participants

fuelxc commented Dec 12, 2011

This change seems more like a workaround than a fix but I am unable to correct any other way and my previous change for including :class => lambda{} doesn't seem to be working in all cases

added the passing of the controller to the lambda


jeremyf commented May 11, 2012

@fuelxc Unfortunately the pull requests don't cleanly merge against master. Would you be able to rebase this and ping me to verify once you have a clean merge?

Merge branch 'master' of https://github.com/ryanb/cancan
* 'master' of https://github.com/ryanb/cancan:
  Clarify readme for rails 2.3 users
  adding a .rbenv-version file
  Add check for Enumerable as condition value
  adding project status message to readme
  Just add singleton to description of authorize_resource
  Don't remove key-value from the subject hash we might want to use it again.
  adding travis-ci badge
  Pass forward :if and :unless options to the before filter. i.e:
  Fixed bug with params for actions that build new instances with namespaced models
  Use latest with_model gem


fuelxc commented May 11, 2012

I merged and pushed now.



jeremyf commented May 21, 2012

@ryanb The tests all pass. There are quite a few concepts going on, but they look good.


andhapp commented Jun 23, 2012

@fuelxc: Thanks for the pull request and sorry for such a long delay in merging this request. Can you please give us a real-world use case where you encountered this issue originally. Quite a few namespace related pull requests have been merged recently and I just wanted to find out the actual issue this one is solving.


fuelxc commented Jun 25, 2012

It was a fair bit ago, so I apologize that i can't remember exact details, but basically it was an STI and I was getting an exception "Object is not missing constants" on a namespaced controller. The only way I found to correct it was to use a lambda to determine what was needed on request.

fuelxc commented Jan 16, 2013

Out of curiosity has this been solved a separate way?

xhoy commented Jul 1, 2014

Thanks for your submission! The ryanb/cancan repository has been inactive since Sep 06, 2013.
Since only Ryan himself has commit permissions, the CanCan project is on a standstill.

CanCan has many open issues, including missing support for Rails 4. To keep CanCan alive, an active fork exists at cancancommunity/cancancan. The new gem is cancancan. More info is available at #994.

If your pull request or issue is still applicable, it would be really appreciated if you resubmit it to CanCanCan.

We hope to see you on the other side!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment