summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Thomas <nick@gitlab.com>2018-02-08 17:09:12 +0000
committerNick Thomas <nick@gitlab.com>2018-02-08 17:09:12 +0000
commit5708241b5718e687c2d6e6626689ecaf5c4fb427 (patch)
treed1462f7ef67ce09a39e05a69a01c27473a91e1ab
parentf69d6a742017850b4ed12d4b6724d16379c04f9a (diff)
parent77c1d87feabc6afcad3c3fce44c6884b54345a43 (diff)
downloadgitlab-ce-5708241b5718e687c2d6e6626689ecaf5c4fb427.tar.gz
Merge branch '4852-migration-specs-fail-locally-if-no-geo-db-is-configured' into 'master'
Make resetting column information overridable in EE See merge request gitlab-org/gitlab-ce!17007
-rw-r--r--spec/support/migrations_helpers.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/spec/support/migrations_helpers.rb b/spec/support/migrations_helpers.rb
index ba4a1bee089..06322aa0586 100644
--- a/spec/support/migrations_helpers.rb
+++ b/spec/support/migrations_helpers.rb
@@ -25,14 +25,19 @@ module MigrationsHelpers
clear_schema_cache!
# Reset column information for the most offending classes **after** we
- # migrated the schema up, otherwise, column information could be outdated
- ActiveRecord::Base.descendants.each { |klass| klass.reset_column_information }
+ # migrated the schema up, otherwise, column information could be
+ # outdated. We have a separate method for this so we can override it in EE.
+ ActiveRecord::Base.descendants.each(&method(:reset_column_information))
# Without that, we get errors because of missing attributes, e.g.
# super: no superclass method `elasticsearch_indexing' for #<ApplicationSetting:0x00007f85628508d8>
ApplicationSetting.define_attribute_methods
end
+ def reset_column_information(klass)
+ klass.reset_column_information
+ end
+
def previous_migration
migrations.each_cons(2) do |previous, migration|
break previous if migration.name == described_class.name