Skip to content

Instantly share code, notes, and snippets.

@paulodiniz
Last active November 29, 2017 14:22
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 paulodiniz/dc94c89bf03ee31bc343538741c0e3ae to your computer and use it in GitHub Desktop.
Save paulodiniz/dc94c89bf03ee31bc343538741c0e3ae to your computer and use it in GitHub Desktop.
class AddTypeToBoleto < ActiveRecord::Migration[5.1]
class Boleto < ApplicationRecord; end
def change
add_column :boletos, :type, :string
Boleto.find_each do |boleto|
boleto.type = 'boleto_bancario'
boleto.save!
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment