Commit 7e38cc9c authored by James Lopez's avatar James Lopez

small refactor

parent a6852986
...@@ -10,7 +10,7 @@ module Gitlab ...@@ -10,7 +10,7 @@ module Gitlab
@shared = shared @shared = shared
@project = project @project = project
@project_id = project.id @project_id = project.id
@saved = [] @saved = true
end end
def restore def restore
...@@ -63,16 +63,16 @@ module Gitlab ...@@ -63,16 +63,16 @@ module Gitlab
end end
end end
@saved.all? @saved
end end
def save_relation_hash(relation_hash_batch, relation_key) def save_relation_hash(relation_hash_batch, relation_key)
relation_hash = create_relation(relation_key, relation_hash_batch) relation_hash = create_relation(relation_key, relation_hash_batch)
@saved << restored_project.append_or_update_attribute(relation_key, relation_hash) @saved = false unless restored_project.append_or_update_attribute(relation_key, relation_hash)
# Restore the project again, extra query but let us skip holding the AR objects in memory # Restore the project again, extra query that skips holding the AR objects in memory
@restored_project = Project.find(@project_id) @restored_project.reload
end end
def default_relation_list def default_relation_list
......
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