Rake post without confirmation

Hello,

I need to play lof ot rake posts:remap

Is ti possible to force (without a confirmation Y/n) ?

thanks for help

Ludo

1 Like

I’d do it from rails and skip the rake task. Administrative Bulk Operations might offer some hints on how to do that.

@pfaffman ok thank you I will take a look.

Basically I already have a file with more than 500 url that I need to replace :

  1. rake posts:remap[“old_url1/”,“new_url1”]
  2. rake posts:remap[“old_url2/”,“new_url2”]
  3. etc

I will try to find how I can do with rails. But it will be great if we have switch like --force or --yes to avoid confirm.

Than you for your help

Here’s what I’d do:

DbHelper.remap("old","new")

If you wanted to use the rake task you can try doing a echo y| rake ... or just edit the rake task in ./lib/tasks

1 Like

@pfaffman an error with
DbHelper.remap(“old”,“new”)

But this work fine
echo y| rake posts:remap[“old_url1/”,“new_url1”]

Than you so much.

1 Like

Glad that worked. The DbHelper needs to be run inside rails, not the shell.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.