Skip to content

Instantly share code, notes, and snippets.

@austinhinderer
Created August 29, 2019 00:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save austinhinderer/bca828331f444a781074e0bac30b160f to your computer and use it in GitHub Desktop.
Save austinhinderer/bca828331f444a781074e0bac30b160f to your computer and use it in GitHub Desktop.
Update ActiveRecord::Migrator.migrate in Ruby on Rails for 5.2.X
migration_path = Rails.root.join('db/migrate')
if ActiveRecord.gem_version >= ::Gem::Version.new("5.2.0")
ActiveRecord::MigrationContext.new(migration_path).migrate
else
ActiveRecord::Migrator.migrate(migration_path)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment