Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Andrew <mail@timothyandrew.net>2017-02-16 10:05:10 +0300
committerTimothy Andrew <mail@timothyandrew.net>2017-02-24 14:20:20 +0300
commitf2ed82fa8486875660b80dd061827ac8b86d00b6 (patch)
tree07b0221a225f32de7a3063a4bee2ff97463f9c54 /app/models/namespace.rb
parent3bd2a98f64a12a2e23a6b9ce77427a9c2033a6bf (diff)
Implement final review comments from @DouweM and @rymai
- Have `Uniquify` take a block instead of a Proc/function. This is more idiomatic than passing around a function in Ruby. - Block a user before moving their issues to the ghost user. This avoids a data race where an issue is created after the issues are migrated to the ghost user, and before the destroy takes place. - No need to migrate issues (to the ghost user) in a transaction, because we're using `update_all` - Other minor changes
Diffstat (limited to 'app/models/namespace.rb')
-rw-r--r--app/models/namespace.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/namespace.rb b/app/models/namespace.rb
index 8cc3c1473e2..3137dd32f93 100644
--- a/app/models/namespace.rb
+++ b/app/models/namespace.rb
@@ -99,7 +99,7 @@ class Namespace < ActiveRecord::Base
path = "blank" if path.blank?
uniquify = Uniquify.new
- uniquify.string(path, -> (s) { Namespace.find_by_path_or_name(s) })
+ uniquify.string(path) { |s| Namespace.find_by_path_or_name(s) }
end
end