I have two user models: first from a remote database, both for outdated and internal company goals. (Entrance for employees). The second is our project for public registration and login, but I need one login form. I searched a lot of time, but some solutions confuse me.
The first legacy looks (read-only and authentication):
class CrmUser < ActiveRecord::Base require Rails.root.join('lib', 'devise', 'encryptors', 'sha1')
And secondly, for the public and registration:
class User < ActiveRecord::Base
Now I do not know how to do this. The user controller tries to authenticate with the first model, and when the user does not exist, go to the second model and try again.
Using:
EDIT:
There is something about several models in the wiki for Devise, but I'm a bit confused, there is no more complicated example.
Thank.
Regards, Rado
rado Aug 31 '11 at 9:00 a.m. 2011-08-31 09:00
source share