Browse Source

Removed old code. Fixed store lookup on failure.

Martin Edenhofer 9 years ago
parent
commit
a0b3559522
1 changed files with 2 additions and 8 deletions
  1. 2 8
      app/models/store/file.rb

+ 2 - 8
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)