Browse Source

Only update shop_id in migration

topic-sass
Jason Denney 11 years ago
parent
commit
3d6f698fb9
  1. 3
      db/migrate/20131019023429_change_bike_shop_id.rb

3
db/migrate/20131019023429_change_bike_shop_id.rb

@ -12,9 +12,8 @@ class ChangeBikeShopId < ActiveRecord::Migration
while bikes.map(&:shop_id).include? new_id while bikes.map(&:shop_id).include? new_id
new_id += 1 new_id += 1
end end
bike.shop_id = new_id bike.update_attribute(:shop_id, new_id)
end end
bikes.each(&:save)
end end
def down def down

Loading…
Cancel
Save