rails: fix #to_s(:human_size) deprecation warnings.
Fix this deprecation warning: DEPRECATION WARNING: Integer#to_s(:human_size) is deprecated. Please use Integer#to_formatted_s(:human_size) instead.
This commit is contained in:
@@ -102,7 +102,7 @@ class PostFlag < ApplicationRecord
|
||||
|
||||
flag = post.flags.in_cooldown.last
|
||||
if !is_deletion && flag.present?
|
||||
errors.add(:post, "cannot be flagged more than once every #{Danbooru.config.moderation_period.inspect} (last flagged: #{flag.created_at.to_s(:long)})")
|
||||
errors.add(:post, "cannot be flagged more than once every #{Danbooru.config.moderation_period.inspect} (last flagged: #{flag.created_at.to_formatted_s(:long)})")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<% if upload.post.present? %>
|
||||
<span class="info">
|
||||
<strong>Size</strong>
|
||||
<%= link_to "#{upload.post.file_size.to_s(:human_size, precision: 4)} #{upload.post.file_ext}", upload.post.file_url %>
|
||||
<%= link_to "#{upload.post.file_size.to_formatted_s(:human_size, precision: 4)} #{upload.post.file_ext}", upload.post.file_url %>
|
||||
(<%= upload.post.image_width %>x<%= upload.post.image_height %>)
|
||||
</span>
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user