Guest User

Untitled

a guest
Jun 18th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. class AgregarMostrarHastaAEventos < ActiveRecord::Migration
  2. def self.up
  3. add_column :eventos, :mostrar_hasta, :datetime
  4. Evento.reset_column_information
  5. Evento.find(:all).each do |eve|
  6. eve.mostrar_hasta = (eve.fecha_inicio + 3.day).to_time
  7. eve.save
  8. end
  9. end
  10.  
  11. def self.down
  12. remove_column :eventos, :mostrar_hasta
  13. end
  14. end
Add Comment
Please, Sign In to add comment