From e39d2eb113d14710772f8d6848c29ef1310e706f Mon Sep 17 00:00:00 2001 From: Paul Mackay Date: Mon, 23 Mar 2015 13:47:44 +0000 Subject: [PATCH 1/2] #440: Reset Enterprise columns before querying them. --- db/migrate/20141219034321_add_permalink_to_enterprises.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/db/migrate/20141219034321_add_permalink_to_enterprises.rb b/db/migrate/20141219034321_add_permalink_to_enterprises.rb index 55d8553bf8..5c38ff55a1 100644 --- a/db/migrate/20141219034321_add_permalink_to_enterprises.rb +++ b/db/migrate/20141219034321_add_permalink_to_enterprises.rb @@ -2,6 +2,8 @@ class AddPermalinkToEnterprises < ActiveRecord::Migration def up add_column :enterprises, :permalink, :string + Enterprise.reset_column_information + Enterprise.all.each do |enterprise| counter = 1 permalink = enterprise.name.parameterize From fcfb1aeb87112cdd05932a308f619fab82c58551 Mon Sep 17 00:00:00 2001 From: Paul Mackay Date: Mon, 23 Mar 2015 14:24:16 +0000 Subject: [PATCH 2/2] #440: Try removing validation from update (to prevent geocoding). --- db/migrate/20141219034321_add_permalink_to_enterprises.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/migrate/20141219034321_add_permalink_to_enterprises.rb b/db/migrate/20141219034321_add_permalink_to_enterprises.rb index 5c38ff55a1..cb0ed0d990 100644 --- a/db/migrate/20141219034321_add_permalink_to_enterprises.rb +++ b/db/migrate/20141219034321_add_permalink_to_enterprises.rb @@ -13,7 +13,7 @@ class AddPermalinkToEnterprises < ActiveRecord::Migration counter += 1 end - enterprise.update_attributes!(permalink: permalink) + enterprise.update_attribute('permalink', permalink) end change_column :enterprises, :permalink, :string, null: false