rails: fix deprecated #to_s(:format) method.

Fix this deprecation:

    Deprecate passing a format to #to_s in favor of #to_formatted_s in
    Array, Range, Date, DateTime, Time, BigDecimal, Float and, Integer.

https://guides.rubyonrails.org/7_0_release_notes.html#active-support-deprecations
This commit is contained in:
evazion
2022-02-01 13:19:50 -06:00
parent 6d2a2eee59
commit c4852b3486
2 changed files with 3 additions and 3 deletions

View File

@@ -52,7 +52,7 @@ class DiscordSlashCommand
def embed_footer
dimensions = "#{post.image_width}x#{post.image_height}"
file_size = post.file_size.to_s(:human_size, precision: 4)
file_size = post.file_size.to_formatted_s(:human_size, precision: 4)
text = "#{post.fav_count} ❤ | Rating: #{post.rating.upcase} | #{dimensions} (#{file_size} #{post.file_ext})"
{ text: text }