Adding Devise to existing models

Visto 139 veces
Saltar al primer mensaje no leído

arsduo

no leída,
11 dic 2009, 11:49:0011/12/09
a Devise
Hi everyone,

First of all, thanks for a great gem. I'm really liking Devise and am
excited to implement it both on a new site I'm building and an earlier
one already live....which brings me to my question:

Right now it doesn't seem like there's an easy way to add Devise to an
existing model (e.g. to an existing site). The only way I can see to
do this is to generate a fake model to identify the columns needed and
then create a new migration by hand to add those to the previous
model. That seems clumsy, though, and will generate a number of extra
files.

Are there any plans to create a devise_update generator, or something
along that line? It could be as simple as changing create_table to
change_table in the migration generator. The only problem with that
simple an approach is that you'd throw errors if the model already had
columns of the same name (such as password, a likely problem). If
there are no plans for this, I'll take a stab at it when I get to
working on that existing site, and will update with what I create.

Thanks!

Alex

José Valim

no leída,
11 dic 2009, 11:51:0411/12/09
a plataforma...@googlegroups.com
No plans! Go for it!
--
José Valim

Director of Engineering - Plataforma Tecnologia
http://blog.plataformatec.com.br/

Gerry

no leída,
9 ene 2010, 7:26:179/1/10
a Devise

I can get by the problem of manually updating the schema, though this
is a great idea too.

My problem is that the existing code uses the name "authenticate" as a
class method and I can't figure out the correct way to refer to the
base method from the override in my mode.

Thanks,
Gerry Gleason

Responder a todos
Responder al autor
Reenviar
0 mensajes nuevos