From b6609fe231ae056519c232586d49d5a8351ed2ca Mon Sep 17 00:00:00 2001 From: Diogo Biazus Date: Thu, 5 Jun 2014 14:36:49 -0400 Subject: [PATCH] migration to fix video_embed_url in existing projects (the new url will always contain the // before the host --- db/migrate/20140605174230_fix_vide_embed_urls.rb | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 db/migrate/20140605174230_fix_vide_embed_urls.rb diff --git a/db/migrate/20140605174230_fix_vide_embed_urls.rb b/db/migrate/20140605174230_fix_vide_embed_urls.rb new file mode 100644 index 00000000..a6edb08c --- /dev/null +++ b/db/migrate/20140605174230_fix_vide_embed_urls.rb @@ -0,0 +1,7 @@ +class FixVideEmbedUrls < ActiveRecord::Migration + def change + execute " + UPDATE projects SET video_embed_url = regexp_replace(video_embed_url, '^(\\w)', '//\\1'); + " + end +end