kristianmandrup / cantango

CanCan extension with role oriented permission management, rules caching and much more
MIT License
404 stars 45 forks source link

undefined method `user_can?` #17

Closed sevenseacat closed 12 years ago

sevenseacat commented 12 years ago

I tried setting up CanTango on an existing Rails/Mongoid app and ran into this issue so I've tried setting it up with a new app and replicated it.

A brand new Rails 3.1.3 app with the latest version of Mongoid and CanTango, following the Quickstart tutorial (set up User model, Guest model, Article scaffold) and ran across this issue.

Is CanTango compatible with Mongoid at all?

sevenseacat commented 12 years ago

This was solved by manually calling config.users.register :user, User within the CanTango.config block. It appears that tango_user was not triggering properly for the User model... I suspect Mongoid interferes with things somehow. I guess it can be closed.