From a0b35595224c94daca8d9c519b4ce4d2ec6b7984 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Tue, 2 Feb 2016 14:08:27 +0100 Subject: [PATCH] Removed old code. Fixed store lookup on failure. --- app/models/store/file.rb | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/app/models/store/file.rb b/app/models/store/file.rb index 041e1c54d..6654e58b7 100644 --- a/app/models/store/file.rb +++ b/app/models/store/file.rb @@ -46,13 +46,7 @@ read content of a file def content adapter = self.class.load_adapter("Store::Provider::#{provider}") - c = if sha - adapter.get(sha) - else - # fallback until migration is done - Store::Provider::DB.find_by(md5: md5).data - end - c + adapter.get(sha) end =begin @@ -78,7 +72,7 @@ in case of fixing sha hash use: next if sha == item.sha success = false logger.error "DIFF: sha diff of Store::File.find(#{item.id}) current:#{sha}/db:#{item.sha}/provider:#{item.provider}" - store = Store.find(store_file_id: item.id) + store = Store.find_by(store_file_id: item.id) logger.error "STORE: #{store.inspect}" if fix_it item.update_attribute(:sha, sha)