# Updating Restful Authentication Plug

**URL:** <https://www.ruby-forum.com/t/updating-restful-authentication-plug/122973>\
**Category:** Rails\
**Created:** [December 13, 2007, 4:45am UTC](https://www.ruby-forum.com/t/updating-restful-authentication-plug/122973 "2007-12-13T04:45:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rlwinter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ecccb3/32.png) [@rlwinter](https://www.ruby-forum.com/u/rlwinter)\
**Post date:** [December 13, 2007, 4:45am UTC](https://www.ruby-forum.com/t/updating-restful-authentication-plug/122973/1 "2007-12-13T04:45:31Z")

</div>

Hi all,

Does anyone know if there is information available about updating the  
restful\_authentication plugin on an existing application. There were  
some recent fixes to make it work properly with the Rails 2.0.1  
release.

I have an existing application using the plugin and after updating the  
application to run under Rails 2.0.x I was getting an error related to  
redirect\_to\_url. I changed the line in lib/authentication\_system.rb to  
redirect\_to, which seems to have fixed the error.

However, I also noticed in the notes of the latest version of  
restful\_authentication that there is a new option (–stateful). If I  
want to update my application to take advantage of this feature, or  
any future features, how do I update the authentication system without  
breaking other things in my application? Is there a generator that I  
can run to just update the existing system and not have it think I’m  
doing a initial generation?

To be clear: I’ve already got the migration, and made the necessary  
changes to application\_controller.rb, session\_controller.rb, etc. I  
don’t want to redo that work again after running the generator.

Thanks,  
Robert

---

<div class="post-metadata">

**Author:** ![rlwinter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ecccb3/32.png) [@rlwinter](https://www.ruby-forum.com/u/rlwinter)\
**Post date:** [December 13, 2007, 12:42pm UTC](https://www.ruby-forum.com/t/updating-restful-authentication-plug/122973/2 "2007-12-13T12:42:31Z")

</div>

As a slight side issue, but pertinent to all the authentication plugins.

It seems to be normal to develop an application the add security.  
(I won’t go into if this is a bad approach or not.) because of this  
there will probably be a User table already in existence and some  
application specific fields.

The  
create\_table “users”, :force =\> true do |t|  
zaps them all.

The migration code _should_ check to see if the table exists, should  
check to see if any of its required fields already exist.

That would be a ‘friendly’ approach.

Perhaps the maintainers of those plugins would oblige 🙂

Robert W. said the following on 12/12/07 10:39 PM:

> redirect\_to, which seems to have fixed the error.  
> changes to application\_controller.rb, session\_controller.rb, etc. I  
> don’t want to redo that work again after running the generator.

–  
“Of all tyrannies a tyranny sincerely exercised for the good of its  
victims  
may be the most oppressive. It may be better to live under robber  
barons  
than under omnipotent moral busybodies, The robber baron’s cruelty  
may  
sometimes sleep, his cupidity may at some point be satiated; but those  
who  
torment us for own good will torment us without end, for they do so  
with  
the approval of their own conscience.” -  
C.S. Lewis, _God in the Dock_
