diff --git a/db/migrate/20240216170202_add_rol_to_deploys.rb b/db/migrate/20240216170202_add_rol_to_deploys.rb index 5f629432..93c4553d 100644 --- a/db/migrate/20240216170202_add_rol_to_deploys.rb +++ b/db/migrate/20240216170202_add_rol_to_deploys.rb @@ -6,7 +6,7 @@ class AddRolToDeploys < ActiveRecord::Migration[6.1] add_column :deploys, :rol_id, :integer, index: true Deploy.find_each do |deploy| - rol_id = deploy.site.roles.find_by(rol: 'usuarie', temporal: false).id + rol_id = deploy.site.roles.find_by(rol: 'usuarie', temporal: false)&.id deploy.update_column(:rol_id, rol_id) if rol_id end