diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2018-06-11 12:14:27 +0000 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2018-06-11 12:14:27 +0000 |
commit | a20d3ff2b004e8ab62c037d1a7b9018dcb402913 (patch) | |
tree | 52c8b8dd08c9ae35ea8665c34e90abd3951af002 | |
parent | da791e646d915cca40f52df87289894e4544f7e8 (diff) | |
parent | 58d69d54c57fb1bbe8836f5a1a776edb59077ef5 (diff) | |
download | gitlab-ce-a20d3ff2b004e8ab62c037d1a7b9018dcb402913.tar.gz |
Merge branch 'jprovazn-rails5-opclasses' into 'master'
[Rails5] Add missing `:comment` attribute
Closes #47650
See merge request gitlab-org/gitlab-ce!19612
-rw-r--r-- | config/initializers/postgresql_opclasses_support.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/config/initializers/postgresql_opclasses_support.rb b/config/initializers/postgresql_opclasses_support.rb index 03bda44a630..7b8afc78817 100644 --- a/config/initializers/postgresql_opclasses_support.rb +++ b/config/initializers/postgresql_opclasses_support.rb @@ -41,7 +41,12 @@ module ActiveRecord # Abstract representation of an index definition on a table. Instances of # this type are typically created and returned by methods in database # adapters. e.g. ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter#indexes - class IndexDefinition < Struct.new(:table, :name, :unique, :columns, :lengths, :orders, :where, :type, :using, :opclasses) #:nodoc: + attrs = [:table, :name, :unique, :columns, :lengths, :orders, :where, :type, :using, :opclasses] + + # In Rails 5 the second last attribute is newly `:comment` + attrs.insert(-2, :comment) if Gitlab.rails5? + + class IndexDefinition < Struct.new(*attrs) #:nodoc: end end end |