summaryrefslogtreecommitdiff
path: root/lib/api
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@gitlab.com>2019-07-12 12:31:26 +0000
committerBob Van Landuyt <bob@gitlab.com>2019-07-12 12:31:26 +0000
commitfd407d065861b092dfc4f53ef76ab44991998753 (patch)
tree7f09419bb9f011aec29d54fff6324f4a04c5b9ee /lib/api
parent8ced6aa19036d54e479058f71c419c7e87ee3966 (diff)
parentaeb67dd489b1ccc7f0ab1d702725729ab9cc3e27 (diff)
downloadgitlab-ce-fd407d065861b092dfc4f53ef76ab44991998753.tar.gz
Merge branch 'upgrade-rails-5-2-ce' into 'master'
[CE] Upgrade to Rails 5.2 See merge request gitlab-org/gitlab-ce!30052
Diffstat (limited to 'lib/api')
-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!