bingo: build the card from chosen providers
All checks were successful
Build and Deploy to Production / test (push) Successful in 27s
Build and Deploy to Production / build (push) Successful in 1m1s
Build and Deploy to Production / deploy (push) Successful in 38s

Let visitors tick providers (Yandex, IXcellerate, RTK-DC, Sber, …) and
get the usual 5×5 card made of only those providers' datacenters, first
25 in ranking order, with lines scored as normal. A selection with fewer
than 25 sites leaves the rest of the card empty, so the card is always
5×5. Each provider chip shows crossed/total for the current view.

Datacenters get a provider slug, backfilled from the free-text operator,
guessed for new rows and editable in the admin. Filtered URLs are
noindex with canonical to the plain card.

Assisted-by: Claude:opus-5
This commit is contained in:
Sergei Poljanski 2026-10-11 21:12:47 +04:00
commit c64098813b
Signed by: asxpi
GPG key ID: 4F8851660FA4121B
9 changed files with 155 additions and 8 deletions

View file

@ -0,0 +1,23 @@
Sequel.migration do
up do
# Company grouping for the per-provider cards (Bingo::PROVIDERS slugs).
# Backfilled from the free-text operator; Datacenter#before_create keeps
# new rows filled the same way (Bingo.guess_provider).
add_column :bingo_datacenters, :provider, String
{
'yandex' => %w[Яндекс%], 'ixcellerate' => %w[IXcellerate%], 'rtk' => %w[РТК-ЦОД%],
'atomdata' => %w[Атомдата% Росатом%], 'datapro' => %w[DataPro%], 'selectel' => %w[Selectel%],
'mws' => %w[MWS% МТС%], 'keypoint' => ['Key Point%'], '3data' => %w[3data%], 'sber' => %w[Сбер%],
'megafon' => %w[МегаФон%], 'datahouse' => %w[DataHouse%], 'oxygen' => %w[OXYGEN%], 'linx' => %w[Linx%],
'cloudx' => ['Cloud X%'], 'nkgroup' => ['NK Group%'], 'goznak' => %w[Гознак%]
}.each do |slug, patterns|
patterns.each do |pat|
self[:bingo_datacenters].where(provider: nil).where(Sequel.ilike(:operator, pat)).update(provider: slug)
end
end
end
down do
drop_column :bingo_datacenters, :provider
end
end