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:
Diffstat (limited to 'lib/gitlab')
-rw-r--r--lib/gitlab/git/commit.rb3
-rw-r--r--lib/gitlab/legacy_github_import/user_formatter.rb5
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/gitlab/git/commit.rb b/lib/gitlab/git/commit.rb
index 0b999197cd8..605084f1ec2 100644
--- a/lib/gitlab/git/commit.rb
+++ b/lib/gitlab/git/commit.rb
@@ -93,12 +93,15 @@ module Gitlab
# Commit.last_for_path(repo, 'master', 'Gemfile')
#
def last_for_path(repo, ref, path = nil)
+ # rubocop: disable Rails/FindBy
+ # This is not where..first from ActiveRecord
where(
repo: repo,
ref: ref,
path: path,
limit: 1
).first
+ # rubocop: enable Rails/FindBy
end
# Get commits between two revspecs
diff --git a/lib/gitlab/legacy_github_import/user_formatter.rb b/lib/gitlab/legacy_github_import/user_formatter.rb
index 889e6aaa968..e85d1314eda 100644
--- a/lib/gitlab/legacy_github_import/user_formatter.rb
+++ b/lib/gitlab/legacy_github_import/user_formatter.rb
@@ -38,9 +38,8 @@ module Gitlab
identities = ::Identity.arel_table
User.select(:id)
- .joins(:identities).where(identities[:provider].eq(:github)
- .and(identities[:extern_uid].eq(id)))
- .first
+ .joins(:identities)
+ .find_by(identities[:provider].eq(:github).and(identities[:extern_uid].eq(id)))
.try(:id)
end
# rubocop: enable CodeReuse/ActiveRecord