chatwoot/config
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
..
agents feat: add resolve_conversation tool for Captain V2 scenarios (#13597) 2026-02-20 19:08:36 +05:30
environments chore: Improvements to codespaces (#11635) 2025-05-29 21:18:02 -06:00
initializers feat: wire up auto-sync job backend [AI-150] (#14117) 2026-04-29 14:47:14 +05:30
integration feat(dialogflow): make language_code configurable instead of hardcoded (#13221) 2026-03-25 21:30:17 -07:00
languages feat: Updated public portal header design (#8089) 2023-11-08 17:56:59 -08:00
locales feat: wire up auto-sync job backend [AI-150] (#14117) 2026-04-29 14:47:14 +05:30
app.yml Bump version to 4.13.0 2026-04-16 19:02:23 +05:30
application.rb fix(i18n): align pluralization with locale rules (#14266) 2026-04-27 15:40:00 +05:30
boot.rb Upgrade to rails 6 💎 (#11) 2019-08-19 13:49:57 +05:30
cable.yml fix: Redis 6 on Heroku breaks ActionCable config (#4269) 2022-03-24 19:25:07 +05:30
database.yml perf: enable active record connection pool reaper (#10866) 2025-03-17 19:27:05 -07:00
elastic_apm.yml chore: Support for Elastic APM (#5004) 2022-07-22 11:39:37 +02:00
environment.rb Initial Commit 2019-08-14 15:18:44 +05:30
features.yml feat: wire up auto-sync job backend [AI-150] (#14117) 2026-04-29 14:47:14 +05:30
installation_config.yml feat: account enrichment using context.dev [UPM-27] (#13978) 2026-04-08 11:16:52 +05:30
llm_models.json fix: use committed model registry for RubyLLM (#14067) 2026-04-16 10:28:38 +05:30
llm.yml feat: add global config for captain settings (#13141) 2026-01-12 19:54:19 +05:30
markdown_embeds.yml feat: add GuideJar embed support in HC (#13944) 2026-03-30 14:19:02 +05:30
newrelic.yml fix(revert): "fix: Ignore RoutingError in New Relic error reporting (#14030)" (#14038) 2026-04-10 12:27:15 +05:30
puma.rb chore: Fix puma configuration (#5023) 2022-07-12 12:27:33 +02:00
rds-ca-2019-root.pem chore: add aws rds root cert for tls connection (#3812) 2022-02-01 16:01:25 +05:30
routes.rb fix: Prevent platform banners cloud check from breaking app boot (#14321) 2026-04-29 19:30:06 +04:00
schedule.yml fix: remove bulk_auto_assignment_job cron schedule (#13877) 2026-03-31 10:56:59 +05:30
scout_apm.yml chore: Load only required APMs (#6497) 2023-03-01 14:31:51 +05:30
secrets.yml Use secret_key_base from env 2019-08-15 23:08:36 +05:30
sidekiq.yml chore: add script to throttle bulkreindex job creation and increase meta timeouts(#12626) 2025-10-13 16:21:45 +05:30
spring.rb 🚨Fix Rubocop lint errors 2019-10-20 14:17:26 +05:30
storage.yml Revert "chore: Upgrade Rails to 7.2.2 and update Gemfile dependencies (#11037)" 2026-02-03 21:09:42 -08:00
vite.json feat: Vite + vue 3 💚 (#10047) 2024-10-02 00:36:30 -07:00