From ef196c913c77338be5ebb1e02af2f6225f857080 Mon Sep 17 00:00:00 2001 From: Claire Date: Thu, 31 Mar 2022 00:49:24 +0200 Subject: Fix error MethodError in Chewy::Strategy::Sidekiq::Worker (#17912) Also refactor a bit to reduce code duplication. --- app/helpers/formatting_helper.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'app/helpers') diff --git a/app/helpers/formatting_helper.rb b/app/helpers/formatting_helper.rb index e11156999..a58dd608f 100644 --- a/app/helpers/formatting_helper.rb +++ b/app/helpers/formatting_helper.rb @@ -12,6 +12,7 @@ module FormattingHelper def extract_status_plain_text(status) PlainTextFormatter.new(status.text, status.local?).to_s end + module_function :extract_status_plain_text def status_content_format(status) html_aware_format(status.text, status.local?, preloaded_accounts: [status.account] + (status.respond_to?(:active_mentions) ? status.active_mentions.map(&:account) : [])) -- cgit From 0a8a0fb5990eb6d3842948654d0b6140e776d8a9 Mon Sep 17 00:00:00 2001 From: Claire Date: Fri, 1 Apr 2022 23:59:13 +0200 Subject: Fix unusual number formatting in some locales (#17929) * Fix unusual number formatting in some locales Fixes #17904 * Fix typo --- app/helpers/application_helper.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'app/helpers') diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 651a98a85..9984820da 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -19,8 +19,11 @@ module ApplicationHelper # is looked up from the locales definition, and rails-i18n comes with # values that don't seem to make much sense for many languages, so # override these values with a default of 3 digits of precision. - options[:precision] = 3 - options[:strip_insignificant_zeros] = true + options = options.merge( + precision: 3, + strip_insignificant_zeros: true, + significant: true + ) number_to_human(number, **options) end -- cgit