1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-19 13:19:39 +02:00
Maybe/app/models/setting.rb

20 lines
681 B
Ruby
Raw Normal View History

# Dynamic settings the user can change within the app (helpful for self-hosting)
class Setting < RailsSettings::Base
cache_prefix { "v1" }
field :render_deploy_hook,
type: :string,
default: ENV["RENDER_DEPLOY_HOOK"],
validates: { allow_blank: true, format: { with: /\Ahttps:\/\/api\.render\.com\/deploy\/srv-.+\z/ } }
field :upgrades_mode,
type: :string,
default: ENV.fetch("UPGRADES_MODE", "manual"),
validates: { inclusion: { in: %w[manual auto] } }
field :upgrades_target,
type: :string,
default: ENV.fetch("UPGRADES_TARGET", "release"),
validates: { inclusion: { in: %w[release commit] } }
end