From d418c4cfc09dcc7ee31663b78fb8abbce4e006e8 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Sat, 22 Aug 2015 10:20:20 -0400 Subject: [PATCH] FIX: Bug with migrating old embeddedable hosts with `http://` --- db/migrate/20150822141540_fix_migrated_hosts.rb | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 db/migrate/20150822141540_fix_migrated_hosts.rb diff --git a/db/migrate/20150822141540_fix_migrated_hosts.rb b/db/migrate/20150822141540_fix_migrated_hosts.rb new file mode 100644 index 000000000..d777eddb3 --- /dev/null +++ b/db/migrate/20150822141540_fix_migrated_hosts.rb @@ -0,0 +1,5 @@ +class FixMigratedHosts < ActiveRecord::Migration + def up + execute "UPDATE embeddable_hosts SET host = regexp_replace(host, '^https?:\/\/', '', 'i')" + end +end