Hi,

I solved the same problem by having my data insertion code as part of a
migration.  That way, when you run the

rake production db:migrate:extensions

all your data is inserted.  It's a fairly common command to run anyway
when installing a new extension.

You could even put it in your extensions activate method, but haven't
thought through if that's a good idea or not (it kind of feels wrong
just thinking about it).  It'd get run every time the extension starts
up, so you'd need to put checks in there to ensure that if the data
exists, don't insert again.

H.

On 1/9/2008, "Pacifists" <[EMAIL PROTECTED]> wrote:

>In the extension creation tutorial
>http://wiki.radiantcms.org/Creating_Radiant_Extensions It's
>recommended to keep to convention about installing extensions like:
>
>radiant:extensions:shiny_new_extension:install
>radiant:extensions:shiny_new_extension:uninstall
>
>Correct me if I'm wrong but it's just a recommendation but not
>enforced when installing extensions right? And those :install /
>:uninstall should be just rake tasks defined by the extension? The
>reason I'm asking is because I've managed to write few simple
>extensions, but now I'm stuck with extension that needs to insert some
>data into database on installation to start working. Also it would be
>good to check few dependencies before doing that.
>
>Thanks for your answers up front :)
>_______________________________________________
>Radiant mailing list
>Post:   [email protected]
>Search: http://radiantcms.org/mailing-list/search/
>Site:   http://lists.radiantcms.org/mailman/listinfo/radiant
_______________________________________________
Radiant mailing list
Post:   [email protected]
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

Reply via email to