Merge commit 'fac734b6a8
' into kb_migration
This commit is contained in:
commit
5a661415e2
22 changed files with 121 additions and 14 deletions
|
@ -15,6 +15,7 @@ class UpdateStatusService < BaseService
|
|||
# @option options [String] :text
|
||||
# @option options [String] :spoiler_text
|
||||
# @option options [Boolean] :sensitive
|
||||
# @option options [Boolean] :markdown
|
||||
# @option options [String] :language
|
||||
def call(status, account_id, options = {})
|
||||
@status = status
|
||||
|
@ -112,6 +113,7 @@ class UpdateStatusService < BaseService
|
|||
def update_immediate_attributes!
|
||||
@status.text = @options[:text].presence || @options.delete(:spoiler_text) || '' if @options.key?(:text)
|
||||
@status.spoiler_text = @options[:spoiler_text] || '' if @options.key?(:spoiler_text)
|
||||
@status.markdown = !!@options[:markdown]
|
||||
@status.sensitive = @options[:sensitive] || @options[:spoiler_text].present? if @options.key?(:sensitive) || @options.key?(:spoiler_text)
|
||||
@status.language = valid_locale_cascade(@options[:language], @status.language, @status.account.user&.preferred_posting_language, I18n.default_locale)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue