Forum: Ruby on Rails Restful Authentication

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
jrm (Guest)
on 2008-11-18 03:28
(Received via mailing list)
Hi,

I added authentication to an app that already had a Person model.
Rather than use the Person class to represent "Users" I created a User
model and stored "users" in a users table.  I now want to clean that
up as my "People" can now also be "Users".

My initial stab was to just migrate the authentication columns (encr.
password, salt, login) to the Person model/table and simply get User
to inherit from Person (I did not bother with using a STI type
column):

Person < ActiveRecord::Base
 ...
end

User < Person
 ...
end

Doing this I can still keep all of my authentication specific stuff in
the User class - and all my other code just continues to work as
expected, i.e. it is just an object storage change.

This works as expected, but can anyone see any problems with this
approach.  My initial thought is the attributes that are locked down
via the user class are now accessible via the Person class.

Thanks is advance...

James
This topic is locked and can not be replied to.