diff options
author | Jan Provaznik <jprovaznik@gitlab.com> | 2018-11-13 09:45:10 +0100 |
---|---|---|
committer | Jan Provaznik <jprovaznik@gitlab.com> | 2018-11-22 13:17:55 +0100 |
commit | 4c6073974c3889f26c99ebfb578a987e86328d7c (patch) | |
tree | 9516e17647bef169be6913154a18886db679e372 /lib | |
parent | 2e3dab38295b7c36ab100f20c654fdfaf9b00885 (diff) | |
download | gitlab-ce-4c6073974c3889f26c99ebfb578a987e86328d7c.tar.gz |
Add version migration support to rails 4
When switching to rails 5, we added migration version to all migration
classes. This patch makes it possible to run versioned migrations
also with rails 4
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rails4_migration_version.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/rails4_migration_version.rb b/lib/rails4_migration_version.rb new file mode 100644 index 00000000000..ae48734dfad --- /dev/null +++ b/lib/rails4_migration_version.rb @@ -0,0 +1,16 @@ +# rubocop:disable Naming/FileName +# frozen_string_literal: true + +# When switching to rails 5, we added migration version to all migration +# classes. This patch makes it possible to run versioned migrations +# also with rails 4 + +unless Gitlab.rails5? + module ActiveRecord + class Migration + def self.[](version) + Migration + end + end + end +end |