From 3d6f698fb9637ec81e10796e8b087a8959c0b6c2 Mon Sep 17 00:00:00 2001 From: Jason Denney Date: Sat, 2 Nov 2013 15:12:55 -0400 Subject: [PATCH] Only update shop_id in migration --- db/migrate/20131019023429_change_bike_shop_id.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/db/migrate/20131019023429_change_bike_shop_id.rb b/db/migrate/20131019023429_change_bike_shop_id.rb index 5503edf..e82610c 100644 --- a/db/migrate/20131019023429_change_bike_shop_id.rb +++ b/db/migrate/20131019023429_change_bike_shop_id.rb @@ -12,9 +12,8 @@ class ChangeBikeShopId < ActiveRecord::Migration while bikes.map(&:shop_id).include? new_id new_id += 1 end - bike.shop_id = new_id + bike.update_attribute(:shop_id, new_id) end - bikes.each(&:save) end def down