ugh, fine, save the pets sequentially

This commit is contained in:
Emi Matchu 2013-01-28 03:02:20 -06:00
parent 206811a2fb
commit 482b1a155d

View file

@ -104,9 +104,9 @@ class Pet < ActiveRecord::Base
Rails.logger.info "Reloading #{name} in #{locale}"
reloaded_pet = Pet.load(name, :item_scope => Item.includes(:translations),
:locale => locale)
Pet.connection_pool.with_connection { reloaded_pet.save! }
last_pet_loaded = reloaded_pet
end
reloaded_pets.each(&:save!)
previous_candidates = candidates
candidates = last_pet_loaded.item_translation_candidates