My guess would be when the type is saved to the database, it is being saved as Authority instead of Wobauth::Authority. Try adding a class_name to the association to see if that makes a difference. The users might be wobauth_users depending where it is declared.
Yeah, found it. The problem comes from cancancan/lib/cancan/controller_resource.rb in
def resource_class case @options[:class] when false name.to_sym when nil namespaced_name.to_s.camelize.constantize when String @options[:class].constantize else @options[:class] end end
The error cames from namespaced_name.to_s.camelize.constantize, which resolves to "Authority". I now set
Excellent episode, very useful.
I like it, routing via :modules is very elegant. It works for me in a normal rails application, but i can't get it work inside of a rails engine.
config/routes.rb from the engine:
Controllers:
I get the following error:
It works without specifying :modules, but this means i must place the logic in the main authorities_controller ... so its less elegant. Any idea?
Wolfgang.
My guess would be when the type is saved to the database, it is being saved as Authority instead of Wobauth::Authority. Try adding a class_name to the association to see if that makes a difference. The users might be wobauth_users depending where it is declared.
Yeah, found it. The problem comes from cancancan/lib/cancan/controller_resource.rb in
The error cames from namespaced_name.to_s.camelize.constantize, which resolves to "Authority". I now set
This sets the class name manually. Seems to work now. Thank you for the idea ;-)