# Plugins, Generators and Updates

**URL:** <https://www.ruby-forum.com/t/plugins-generators-and-updates/106006>\
**Category:** Rails\
**Created:** [June 5, 2007, 4:24pm UTC](https://www.ruby-forum.com/t/plugins-generators-and-updates/106006 "2007-06-05T16:24:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pallan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/71c47a/32.png) [@pallan](https://www.ruby-forum.com/u/pallan)\
**Post date:** [June 5, 2007, 4:24pm UTC](https://www.ruby-forum.com/t/plugins-generators-and-updates/106006/1 "2007-06-05T16:24:00Z")

</div>

Hi all,

I am writing a plugin that we plan to use on some future websites we are  
building. My question is more of a poll of everyone’s preferences on  
the deployment of a plugin. I am at the point now where I have to  
decide if this plugin should use a generator to copy all the necessary  
files into the rails application (models, migrations, etc.) or if I  
should keep all the plugin files contained in the plugin folder.

I am leaning towards the generator approach, like acts\_as\_authenticated,  
but I can’t find any information as to what happens when I update the  
plugin. If all the files have been copied over to the application what  
is the best way to update those files? Do I use the generator to copy  
the new files and overwrite the existing? For the models this seems  
fine, but what about migrations? How would i know which migrations need  
to be copied over and which don’t?

I have been having trouble finding a lot of information to this topic so  
any help would be appreciated. Thanks.

Peer

---

<div class="post-metadata">

**Author:** ![pallan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/71c47a/32.png) [@pallan](https://www.ruby-forum.com/u/pallan)\
**Post date:** [June 5, 2007, 6:54pm UTC](https://www.ruby-forum.com/t/plugins-generators-and-updates/106006/2 "2007-06-05T18:54:05Z")

</div>

Peer A. wrote:

> I am leaning towards the generator approach, like acts\_as\_authenticated,  
> but I can’t find any information as to what happens when I update the  
> plugin. If all the files have been copied over to the application what  
> is the best way to update those files? Do I use the generator to copy  
> the new files and overwrite the existing? For the models this seems  
> fine, but what about migrations? How would i know which migrations need  
> to be copied over and which don’t?

Take a look at the “engine” plugin. It provides a higher-level interface  
than the base plugin system provides handling issues of mixin  
functionality between plugin and application, copying of resources and  
migrations.

You can always do it yourself with the base plugin system but why spend  
the time. The “engine” plugin gives you a higher-level interface  
allowing you to focus on the functionality of your plugin instead of  
low-level mechanics.

Eric
