Files
sure/lib/feature_flags.rb
Copilot 1527611239 Default production SSO provider source to YAML to avoid boot-time schema errors (#1278)
* Initial plan

* Default production SSO provider source to YAML

Co-authored-by: jjmata <187772+jjmata@users.noreply.github.com>
Agent-Logs-Url: https://github.com/we-promise/sure/sessions/d3a36ca8-e936-4687-a466-9b4c93c19150

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: jjmata <187772+jjmata@users.noreply.github.com>
2026-03-25 15:08:36 +01:00

23 lines
657 B
Ruby

# frozen_string_literal: true
module FeatureFlags
class << self
def db_sso_providers?
auth_source = ENV["AUTH_PROVIDERS_SOURCE"]
return auth_source.to_s.downcase == "db" if auth_source.present?
# In production, prefer YAML by default so boot-time tasks (e.g. db:prepare)
# do not attempt to query SSO provider tables before migrations run.
return false if Rails.env.production?
auth_source = Rails.configuration.app_mode.self_hosted? ? "db" : "yaml"
auth_source.to_s.downcase == "db"
end
def intro_ui?
Rails.configuration.x.ui.default_layout.to_s.in?(%w[intro dashboard])
end
end
end