Forum: Rails Engines single table inheritance for different user types?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Daniel Holmlund (Guest)
on 2006-01-11 19:35
First of all, I wanted to give a harty "thank you" to James A.s for
creating rails engines, which seems like a very natural way to increase
codesharing and productivity.

My question is how have people implemented different types of users in
their Web applications?

As for my application, I use single table inheritance in order to derive
several different types of users, such as "moderators," "editors," etc

For example, let's say that I want to create a moderator. I define a new
moderator class and Controller like so:

class Moderator < User

class ModeratorController < UserController

My problem with this is that since several functions such as "login,"
"signup" and others directly call the User class. I cannot simply
inherit the ModeratorController from UserController without overriding
everyone of these functions and changing every instance of "User" with

I think there must be a simple and elegant solution to this.  Any
James A. (Guest)
on 2006-01-11 23:09
(Received via mailing list)
Hi Daniel -

See my reply on the Rails list to this.


- james
This topic is locked and can not be replied to.