akkounts/app/models/concerns/settings/nostr_settings.rb
Râu Cao 4ae10c9b53
All checks were successful
continuous-integration/drone/push Build is passing
Refactor settings model
Move the various sections to their own concerns, so they're easier to
find and maintain
2024-08-28 14:39:08 +02:00

23 lines
568 B
Ruby

module Settings
module NostrSettings
extend ActiveSupport::Concern
included do
field :nostr_enabled, type: :boolean,
default: ENV["NOSTR_PRIVATE_KEY"].present?
field :nostr_private_key, type: :string,
default: ENV["NOSTR_PRIVATE_KEY"].presence
field :nostr_public_key, type: :string,
default: ENV["NOSTR_PUBLIC_KEY"].presence
field :nostr_relay_url, type: :string,
default: ENV["NOSTR_RELAY_URL"].presence
field :nostr_zaps_relay_limit, type: :integer,
default: 12
end
end
end