diff --git a/db/migrate/20151001024122_mapping_polymorphism.rb b/db/migrate/20151001024122_mapping_polymorphism.rb index 6ba88f7c..e41233f6 100644 --- a/db/migrate/20151001024122_mapping_polymorphism.rb +++ b/db/migrate/20151001024122_mapping_polymorphism.rb @@ -17,6 +17,7 @@ class MappingPolymorphism < ActiveRecord::Migration unless mapping.synapse_id.nil? mapping.mappable = Synapse.find(mapping.synapse_id) else + next if mapping.topic_id == 0 mapping.mappable = Topic.find(mapping.topic_id) end mapping.save