Agregar todos los consensos sueltos a la Asamblea General

This commit is contained in:
fauno 2019-08-31 12:22:46 -03:00
parent f44abbc7c5
commit a7dd195c20
No known key found for this signature in database
GPG key ID: 456032D717A4CD9C

View file

@ -0,0 +1,18 @@
# frozen_string_literal: true
# Agrega todos los consensos sueltos a la asamblea general
class AddConsensosToAsambleaGeneral < ActiveRecord::Migration[5.2]
def up
return unless Rails.env == 'production'
barca = Barca.find_or_create_by(nombre: 'Asamblea General')
Consenso.where(barca_id: nil).find_each do |consenso|
barca.consensos << consenso
end
barca.save
end
def down; end
end