Commit 612a653c authored by Michael Rose's avatar Michael Rose

index: character: characters can be reassigned fandoms

parent c656d9c6
......@@ -7,12 +7,15 @@ class IndexCharacterWorker
character = Character.where(:id => character_id).first
name = body['name']
fandom_id = body['fandom_id'].to_i
if character.nil?
character = Character.create(:id => character_id, :fandom_id => body['fandom_id'].to_i)
character = Character.create(:id => character_id, :fandom_id => fandom_id)
end
if !body['name'].nil? && character.name != body['name']
character.name = body['name']
if (!name.nil? && character.name != name) || character.fandom_id != fandom_id
character.name = name
character.fandom_id = fandom_id
character.save
end
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment