Skip to content

Commit

Permalink
[rails6][MiqServer] Use proper ActionView constructor
Browse files Browse the repository at this point in the history
This was changed in Rails 6:

rails/rails@e17fe52

And using `.empty` is good enough for our case since we are just trying
to access the helper method, `.number_to_human_size`, outside the
context of the views.
  • Loading branch information
NickLaMuro committed Nov 5, 2020
1 parent ad9aa86 commit b82060a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/miq_server/environment_management.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def check_disk_usage(disks)
end

next unless disk_usage_event
msg = "Filesystem: #{disk[:filesystem]} (#{disk[:type]}) on #{disk[:mount_point]} is #{disk[:used_bytes_percent]}% full with #{ActionView::Base.new.number_to_human_size(disk[:available_bytes])} free."
msg = "Filesystem: #{disk[:filesystem]} (#{disk[:type]}) on #{disk[:mount_point]} is #{disk[:used_bytes_percent]}% full with #{ActionView::Base.empty.number_to_human_size(disk[:available_bytes])} free."
MiqEvent.raise_evm_event_queue(self, disk_usage_event, :event_details => msg)
end
end
Expand Down

0 comments on commit b82060a

Please sign in to comment.