chatwoot/app/controllers
Muhsin Keloth e723c6b6f2
fix: Prevent platform banners cloud check from breaking app boot (#14321)
The `ChatwootApp.chatwoot_cloud?` gate on the platform banners route in
#13943 reads `InstallationConfig` from the database. Because `routes.rb`
is evaluated during `Rails.application.initialize!`, this ran before the
database existed on a fresh setup, breaking `bundle exec rake db:create`
in CI and first-time installs with `ActiveRecord::NoDatabaseError: We
could not find your database: chatwoot_test`.

The route is now always mounted, and the cloud check moved to where the
database is guaranteed to be available — the controller
(`before_action`) and the super admin sidebar partial.

Closes the CI failure introduced by #13943.

## How to test
1. Drop your local databases: `bundle exec rake db:drop`
2. Run `bundle exec rake db:create` — it should succeed (previously
failed with `NoDatabaseError`)
3. Bring the DB back: `bundle exec rake db:setup`
4. On a non-cloud install, visit `/super_admin/platform_banners` —
should 404, and the sidebar entry should be hidden
5. With `DEPLOYMENT_ENV=cloud` configured (cloud install), the page and
sidebar entry should work as before

## What changed
- `config/routes.rb` — always mount `resources :platform_banners` (no DB
call at boot)
- `app/controllers/super_admin/platform_banners_controller.rb` —
`before_action` raises `ActionController::RoutingError` (404) when not
on Chatwoot Cloud
- `app/views/super_admin/application/_navigation.html.erb` — hides the
sidebar entry on non-cloud installs

---------

Co-authored-by: Muhsin <12408980+muhsin-k@users.noreply.github.com>
2026-04-29 19:30:06 +04:00
..
api feat: onboarding account details with enriched data [UPM-17][UPM-18] (#13979) 2026-04-28 10:35:51 +05:30
auth feat: ensure signup verification [UPM-14] (#13858) 2026-04-07 13:45:17 +05:30
concerns Revert: Validate Twilio webhook signatures (X-Twilio-Signature) (#14125) 2026-04-21 19:16:08 +04:00
devise_overrides chore: rotate oauth password if unconfirmed (#13878) 2026-04-02 11:26:29 +05:30
google feat: use of imap login as default if present (#10249) 2024-10-09 15:01:11 +05:30
instagram feat: Instagram reauthorization (#11221) 2025-04-03 14:30:48 +05:30
installation feat: Unify user and super admin credentials (#3830) 2022-01-25 16:58:49 -08:00
linear feat(linear): Support refresh tokens and migrate legacy OAuth tokens (#13721) 2026-03-17 13:09:03 +04:00
microsoft feat: add Google login flow and inbox creation (#9580) 2024-06-07 16:37:46 +05:30
notion feat: Whatsapp embedded signup (#11612) 2025-07-14 21:37:06 -07:00
platform/api/v1 fix(agent-bots): destroy permissibles on AgentBot deletion and skip orphans in index (#14273) 2026-04-27 19:17:32 +05:30
public/api/v1 chore: allow article to create without content (#14007) 2026-04-09 10:40:37 +05:30
shopify feat(apps): Shopify Integration (#11101) 2025-03-19 15:37:55 -07:00
super_admin fix: Prevent platform banners cloud check from breaking app boot (#14321) 2026-04-29 19:30:06 +04:00
survey feat: Add INSTALLATION_NAME to global config (#12376) 2025-09-09 12:13:35 +05:30
tiktok feat: TikTok channel (#12741) 2025-12-17 07:54:50 -08:00
twilio Revert: Validate Twilio webhook signatures (X-Twilio-Signature) (#14125) 2026-04-21 19:16:08 +04:00
twitter fix: response body in twitter callback (#6907) 2023-04-14 16:48:28 +05:30
webhooks feat(shopify): Add mandatory compliance webhooks with HMAC verification (#13549) 2026-02-17 16:52:13 +05:30
android_app_controller.rb chore: Universal Linking for Android (#2324) 2021-06-02 08:46:45 -07:00
api_controller.rb chore: Upgrade to Rails 7 (#6719) 2023-05-06 10:44:52 +05:30
apple_app_controller.rb Chore: Apple site association file for deep linking (#805) 2020-05-03 12:16:11 +05:30
application_controller.rb feat: Conversation API to return applied_sla and sla_events (#9174) 2024-04-01 23:30:07 +05:30
dashboard_controller.rb feat: Add platform-wide status banners for outage notifications (#13943) 2026-04-29 17:18:38 +04:00
health_controller.rb feat: add lightweight /health endpoint (#13386) 2026-01-29 00:24:01 +05:30
microsoft_controller.rb chore: Automate SSL with Cloudflare (#12021) 2025-07-24 13:09:06 +04:00
oauth_callback_controller.rb refactor: use state-based authentication (#11690) 2025-06-18 17:39:06 +05:30
platform_controller.rb Chore: Inbox Members API improvements (#3008) 2021-09-14 11:55:02 +05:30
public_controller.rb feat: disable helpcenter on hacker plans (#12068) 2026-03-26 23:48:46 -07:00
slack_uploads_controller.rb fix: handle active storage preview error for password protected pdfs (#11888) 2025-08-11 12:41:37 +05:30
swagger_controller.rb chore: Enable the new Rubocop rules (#7122) 2023-05-19 14:37:10 +05:30
widget_tests_controller.rb feat: Support Dark mode for the widget (#4137) 2022-04-01 20:59:03 +05:30
widgets_controller.rb feat(widget): Allow widget loading in mobile app WebViews when domain restrictions are set (#13763) 2026-03-17 14:29:41 +04:00