summaryrefslogtreecommitdiff
path: root/lib/api/helpers
diff options
context:
space:
mode:
authorHeinrich Lee Yu <heinrich@gitlab.com>2019-06-26 01:54:42 +0800
committerHeinrich Lee Yu <heinrich@gitlab.com>2019-07-12 10:15:31 +0800
commitaeb67dd489b1ccc7f0ab1d702725729ab9cc3e27 (patch)
treec508ba9459274be6a8a0488a838d31f03f45faba /lib/api/helpers
parentecffca5d92353d55aaf8f984737fa617782310e0 (diff)
downloadgitlab-ce-aeb67dd489b1ccc7f0ab1d702725729ab9cc3e27.tar.gz
Upgrade to Rails 5.2upgrade-rails-5-2-ce
Updates changed method names and fixes spec failures
Diffstat (limited to 'lib/api/helpers')
-rw-r--r--lib/api/helpers/pagination.rb4
-rw-r--r--lib/api/helpers/runner.rb3
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/api/helpers/pagination.rb b/lib/api/helpers/pagination.rb
index 2a9b17ad22a..71bbc218f94 100644
--- a/lib/api/helpers/pagination.rb
+++ b/lib/api/helpers/pagination.rb
@@ -205,7 +205,9 @@ module API
limited_total_count = pagination_data.total_count_with_limit
if limited_total_count > Kaminari::ActiveRecordRelationMethods::MAX_COUNT_LIMIT
- pagination_data.without_count
+ # The call to `total_count_with_limit` memoizes `@arel` because of a call to `references_eager_loaded_tables?`
+ # We need to call `reset` because `without_count` relies on `@arel` being unmemoized
+ pagination_data.reset.without_count
else
pagination_data
end
diff --git a/lib/api/helpers/runner.rb b/lib/api/helpers/runner.rb
index ff73a49d5e8..100463fcb95 100644
--- a/lib/api/helpers/runner.rb
+++ b/lib/api/helpers/runner.rb
@@ -7,8 +7,7 @@ module API
JOB_TOKEN_PARAM = :token
def runner_registration_token_valid?
- ActiveSupport::SecurityUtils.variable_size_secure_compare(params[:token],
- Gitlab::CurrentSettings.runners_registration_token)
+ ActiveSupport::SecurityUtils.secure_compare(params[:token], Gitlab::CurrentSettings.runners_registration_token)
end
def authenticate_runner!