Commit 03998633 authored by Stan Hu's avatar Stan Hu

Merge branch '336529-remove-build_select-override-for-enumerating-columns' into 'master'

Remove build_select override for enumerating columns

See merge request gitlab-org/gitlab!66933
parents a4d5b9a8 6587c5b3
......@@ -28,8 +28,6 @@ class GroupMember < Member
attr_accessor :last_owner, :last_blocked_owner
self.enumerate_columns_in_select_statements = true
def self.access_level_roles
Gitlab::Access.options_with_owner
end
......
......@@ -9,10 +9,6 @@
# statement cache. If a different migration is then run and one of these columns is
# removed in the meantime, the query is invalid.
ActiveRecord::Base.class_eval do
class_attribute :enumerate_columns_in_select_statements
end
module ActiveRecord
module QueryMethods
private
......@@ -20,8 +16,6 @@ module ActiveRecord
def build_select(arel)
if select_values.any?
arel.project(*arel_columns(select_values.uniq))
elsif klass.enumerate_columns_in_select_statements
arel.project(*klass.column_names.map { |field| table[field] })
else
arel.project(@klass.arel_table[Arel.star])
end
......
......@@ -19,7 +19,6 @@ module EE
include FromUnion
self.inheritance_column = :_type_disabled
self.enumerate_columns_in_select_statements = true
# backported from ApplicationRecord
def self.cached_column_list
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment