Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class AgregarMostrarHastaAEventos < ActiveRecord::Migration
- def self.up
- add_column :eventos, :mostrar_hasta, :datetime
- Evento.reset_column_information
- Evento.find(:all).each do |eve|
- eve.mostrar_hasta = (eve.fecha_inicio + 3.day).to_time
- eve.save
- end
- end
- def self.down
- remove_column :eventos, :mostrar_hasta
- end
- end
Add Comment
Please, Sign In to add comment