From b27d6825178d5c32ae79ec30687bb216c0ba4a39 Mon Sep 17 00:00:00 2001 From: Jason Denney Date: Sat, 19 Oct 2013 16:28:09 -0400 Subject: [PATCH] Bug caused by Bike.wheel_size no longer existing --- db/migrate/20131019170248_alter_bike_wheel_to_id.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db/migrate/20131019170248_alter_bike_wheel_to_id.rb b/db/migrate/20131019170248_alter_bike_wheel_to_id.rb index 9ed6330..03e0f38 100644 --- a/db/migrate/20131019170248_alter_bike_wheel_to_id.rb +++ b/db/migrate/20131019170248_alter_bike_wheel_to_id.rb @@ -4,7 +4,7 @@ class AlterBikeWheelToId < ActiveRecord::Migration undetermined_id = BikeWheelSize.find_by_rdin("0") Bike.find_each do |bike| - wheel_size = BikeWheelSize.find_by_rdin(bike.wheel_size.to_s) + wheel_size = BikeWheelSize.find_by_rdin(bike['wheel_size'].to_s) if wheel_size.nil? wheel_size_id = undetermined_id @@ -23,7 +23,7 @@ class AlterBikeWheelToId < ActiveRecord::Migration add_column :bikes, :wheel_size, :integer Bike.find_each do |bike| - wheel_size = BikeWheelSize.find_by_id(bike.bike_wheel_size_id) + wheel_size = BikeWheelSize.find_by_id(bike['bike_wheel_size_id']) bike.wheel_size = wheel_size.rdin.to_i bike.save end