Although I don''t have a lot of knowledge on single table inheritance
it does seem more logical to do that the other solution :-)
Jaap
On 10/22/05, Matt Carr <bikokid-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Hi,
> I''m looking to have a group of Patients, and Clinicians. Both of
which are
> users.
> but i''m having some trouble. Basically, I want both to be able to
login and
> then be redirected to a different setion of the website.
>
> I was thinking of doing it this way,
>
> user.rb :
> class User < ActiveRecord::Base
> has_one :patient
> has_one :clinician
> #....
> end
>
> patient.rb :
> class Patient < ActiveRecord::Base
> belongs_to :user
> end
>
> patient.rb :
> class Clinician < ActiveRecord::Base
> belongs_to :user
> end
>
> but a User is either a patient, or a clinician. Not both. Is single table
> inheritance a better answer? Anyone have a link where something similar is
> being done? Thanks
> -matt
>
>
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
>
>