Skip to content

Commit 01d47ca

Browse files
committed
Polyfill Rails 5 versioned migrations
1 parent eee3ab5 commit 01d47ca

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

test/dummy/lib/migration_database_helper.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
# polyfill Rails >= 5 versioned migrations
2+
3+
unless ActiveRecord::Migration.respond_to?(:[])
4+
module ActiveRecord
5+
class Migration
6+
def self.[](_version)
7+
self
8+
end
9+
end
10+
end
11+
end
12+
113
module MigrationDatabaseHelper
214
def json_supported_database?
315
(postgres? && postgres_correct_version?) || (mysql? && mysql_correct_version?)

0 commit comments

Comments
 (0)