From b64041602825fb2e0b9134a2d387f50b73eb96f4 Mon Sep 17 00:00:00 2001 From: f Date: Sat, 25 Sep 2021 19:34:21 -0300 Subject: [PATCH] Resolver un problema de huevo y gallina --- db/migrate/20210809155434_add_canonical_deploy_to_sites.rb | 2 -- test/factories/site.rb | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/db/migrate/20210809155434_add_canonical_deploy_to_sites.rb b/db/migrate/20210809155434_add_canonical_deploy_to_sites.rb index 79b6af96..c1881336 100644 --- a/db/migrate/20210809155434_add_canonical_deploy_to_sites.rb +++ b/db/migrate/20210809155434_add_canonical_deploy_to_sites.rb @@ -22,8 +22,6 @@ class AddCanonicalDeployToSites < ActiveRecord::Migration[6.1] site.update_columns canonical_deploy_id: deploy.id end - - change_column :sites, :canonical_deploy_id, :bigint, null: false end def down diff --git a/test/factories/site.rb b/test/factories/site.rb index 7d91f841..3bfe4f35 100644 --- a/test/factories/site.rb +++ b/test/factories/site.rb @@ -13,7 +13,7 @@ FactoryBot.define do # Factory porque necesitamos que el sitio se genere solo. # # @see {https://github.com/thoughtbot/factory_bot/wiki/How-factory_bot-interacts-with-ActiveRecord} - site.deploys.build(type: 'DeployLocal') + site.canonical_deploy = site.deploys.build(type: 'DeployLocal') end end end