diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-31 15:08:09 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-31 15:08:09 +0300 |
commit | 0d0cddc9ce20c5a7d8a2723d0aa620ca184a711a (patch) | |
tree | 64f91b4d4ca74aa09d2a62ac5910820d087ed7cb /lib | |
parent | 6044caed20964a70c1ac6c5a3365d567ed96dfde (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib')
-rw-r--r-- | lib/feature/gitaly.rb | 3 | ||||
-rw-r--r-- | lib/gitlab/git/commit.rb | 3 | ||||
-rw-r--r-- | lib/gitlab/legacy_github_import/user_formatter.rb | 5 |
3 files changed, 8 insertions, 3 deletions
diff --git a/lib/feature/gitaly.rb b/lib/feature/gitaly.rb index d327162b34e..2d0fdf98e8c 100644 --- a/lib/feature/gitaly.rb +++ b/lib/feature/gitaly.rb @@ -14,6 +14,9 @@ class Feature end def server_feature_flags + # We need to check that both the DB connection and table exists + return {} unless ::Gitlab::Database.cached_table_exists?(FlipperFeature.table_name) + Feature.persisted_names .select { |f| f.start_with?(PREFIX) } .map do |f| 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 |