diff options
author | Jasper Maes <jaspermaes.jm@gmail.com> | 2019-01-16 00:05:36 +0300 |
---|---|---|
committer | Heinrich Lee Yu <heinrich@gitlab.com> | 2019-04-23 03:31:23 +0300 |
commit | 624a1cdab4da67c7b363602aa1178d0e6ff63475 (patch) | |
tree | 09892175f885c4c5f6725314b25a61280395efcb /lib | |
parent | 46bdbc5d776a0438366426e0ef48911123311744 (diff) |
Upgrade Rails to 5.1.6.1
Model.new.attributes now also returns encrypted attributes.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/performance_bar/peek_query_tracker.rb | 6 | ||||
-rw-r--r-- | lib/gitlab/search_results.rb | 6 |
2 files changed, 4 insertions, 8 deletions
diff --git a/lib/gitlab/performance_bar/peek_query_tracker.rb b/lib/gitlab/performance_bar/peek_query_tracker.rb index ac392432427..16c16aa0265 100644 --- a/lib/gitlab/performance_bar/peek_query_tracker.rb +++ b/lib/gitlab/performance_bar/peek_query_tracker.rb @@ -26,11 +26,7 @@ module Gitlab subscribe('sql.active_record') do |_, start, finish, _, data| if Gitlab::SafeRequestStore.store[:peek_enabled] - # data[:cached] is only available starting from Rails 5.1.0 - # https://github.com/rails/rails/blob/v5.1.0/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb#L113 - # Before that, data[:name] was set to 'CACHE' - # https://github.com/rails/rails/blob/v4.2.9/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb#L80 - unless data.fetch(:cached, data[:name] == 'CACHE') + unless data[:cached] track_query(data[:sql].strip, data[:binds], start, finish) end end diff --git a/lib/gitlab/search_results.rb b/lib/gitlab/search_results.rb index 8988b9ad7be..a29517e068f 100644 --- a/lib/gitlab/search_results.rb +++ b/lib/gitlab/search_results.rb @@ -113,7 +113,7 @@ module Gitlab issues.full_search(query) end - issues.reorder('updated_at DESC') + issues.reorder('issues.updated_at DESC') end # rubocop: enable CodeReuse/ActiveRecord @@ -121,7 +121,7 @@ module Gitlab def milestones milestones = Milestone.where(project_id: project_ids_relation) milestones = milestones.search(query) - milestones.reorder('updated_at DESC') + milestones.reorder('milestones.updated_at DESC') end # rubocop: enable CodeReuse/ActiveRecord @@ -139,7 +139,7 @@ module Gitlab merge_requests.full_search(query) end - merge_requests.reorder('updated_at DESC') + merge_requests.reorder('merge_requests.updated_at DESC') end # rubocop: enable CodeReuse/ActiveRecord |