Class: TelegramBotEngine::Admin::DashboardController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/telegram_bot_engine/admin/dashboard_controller.rb

Instance Method Summary collapse

Instance Method Details

#showObject



6
7
8
9
10
11
12
13
14
15
16
17
# File 'app/controllers/telegram_bot_engine/admin/dashboard_controller.rb', line 6

def show
  @bots = Bot.order(:name)
  @bot_active_counts = @bots.index_with { |bot| Subscription.active.for_bot(bot).count }

  @total_subscriptions = Subscription.count
  @active_subscriptions = Subscription.active.count
  @inactive_subscriptions = @total_subscriptions - @active_subscriptions

  # Legacy single-bot fallback (docs/0001 ยง3.8): only shown until bots-as-data
  # rows exist, so pre-multi-bot installs still render their bot identity.
  @bot_username = bot_username
end