Search code examples
ruby-on-railsauthenticationspree

Spree authentication with multiple user models


I am attempting to incorporate spree in a Rails app that is setup authenticating with a separate User and Admin Model.

Everything I have found suggests that spree only supports the single model (out of the box) with CanCan for roles. I am still diving into the Spree documentation but I get the feeling this might be more difficult than it would seem. Would be great to have some direction or advice.


Solution

  • This is correct. Spree only supports one user model at a time. I would suggest merging your user and admin user objects into the same table and then using a boolean flag to dictate if someone is an admin or not.