* Wip: マイグレーション、設定など一式 * Fix test * Fix test * Fix: マスター用の設定を他サーバーに送信しないよう修正 * DTL、外部サーバーの情報受け入れのテストを追加 * スペルミスを修正 * Web画面に設定項目追加 * 既存の`master_settings`を上書きしないよう修正
This commit is contained in:
parent
a7dec3c59b
commit
76f2f2ed0c
26 changed files with 284 additions and 52 deletions
28
app/models/concerns/account_master_settings.rb
Normal file
28
app/models/concerns/account_master_settings.rb
Normal file
|
@ -0,0 +1,28 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module AccountMasterSettings
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
included do
|
||||
def subscription_policy
|
||||
return master_settings['subscription_policy']&.to_sym || :allow if master_settings.present?
|
||||
|
||||
# allow, followers_only, block
|
||||
:allow
|
||||
end
|
||||
|
||||
def subscription_policy=(val)
|
||||
self.master_settings = (master_settings.nil? ? {} : master_settings).merge({ 'subscription_policy' => val })
|
||||
end
|
||||
|
||||
def all_subscribable?
|
||||
subscription_policy == :allow
|
||||
end
|
||||
|
||||
def public_master_settings
|
||||
{
|
||||
'subscription_policy' => subscription_policy,
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
|
@ -104,7 +104,7 @@ module AccountOtherSettings
|
|||
end
|
||||
|
||||
def public_settings_for_local
|
||||
public_settings
|
||||
public_settings.merge(public_master_settings)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue