Skip to content

Instantly share code, notes, and snippets.

@MarkNijhof
Created January 5, 2011 13:50
Show Gist options
  • Save MarkNijhof/766331 to your computer and use it in GitHub Desktop.
Save MarkNijhof/766331 to your computer and use it in GitHub Desktop.
1
I have a weird issue with rails3
I have two models User and AuthenticationProvider, I also have a helper UserManager in the namespace Authentication::UserHelper. The UserManager uses both models
/app/
/models/
/User
/AuthenticationProvider
/helpers/
/authentication/
/user_helper < class UserManager
Now when I run my rspec tests all goes fine, but when I use the UserManager from a controller I get the models being scoped within the helper namespace. So my error is:
uninitialized constant Authentication::UserHelper::UserManager::AuthenticationProvider
While the AuthenticationProvider is just in the models folder?
I checked the load paths and they seem fine, first I thought it might be because I use rake to trigger the rails server command, but I checked without and also using Thin as the server, same results.
As I said this goes fine using directly from rspec (rspec tests don't go through the controller).
Any help/hints would be appreciated!
-Mark
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment