Skip to content

Instantly share code, notes, and snippets.

@mmontalvo
Created February 28, 2019 21:36
Show Gist options
  • Save mmontalvo/fe945059f85b10598363428c2333bffb to your computer and use it in GitHub Desktop.
Save mmontalvo/fe945059f85b10598363428c2333bffb to your computer and use it in GitHub Desktop.
file_names = Dir["db/migrate/*"]
file_names.each do |file_name|
lines = File.readlines(file_name)
lines[0] = lines[0].gsub('ActiveRecord::Migration', 'ActiveRecord::Migration[5.2]')
File.open(file_name, 'w') { |f| f.write(lines.join) }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment