I’m somewhat new with RoR, but have been programming for a while. I’m
trying to design the right model for an application which will have a
login system, I’m leaning towards acts_as_authenticated.
I have one confusion, though… In my app, I want to have one login
system which will allow general Clients and Employees to login. These
have all similar characteristics shared with the User table created
by AAA, but also have other methods and behaviors to deal with the
rest of my app.
How should I define the Client model, for instance? Would it be
class Client < User
since I already have user.rb defining the User class as such:
class User < ActiveRecord::Base
or would I be forced to compromise and create different Client and
Employee tables and models, each with its own salt, hashed_passwords
and the like?
I figure by inheriting from User, I should be able to define the User
model with all the relevant methods and properties. Must I have all
the classes in the same file, or am I able to have a client.rb file
where I inherit User?
Thanks for any help in advance,
Mauricio L. Sadicoff
“Peace of mind isn’t at all superficial, really,” I expound. “It’s
the whole thing. That which produces it is good maintenance; that
which disturbs it is poor maintenance. What we call workability of
the machine is just an objectification of this peace of mind. The
ultimate test is always your own serenity.” - Zen and the Art of