diff --git a/app/models/vm_reconfigure_task.rb b/app/models/vm_reconfigure_task.rb index de22865c6ef..8c4b07f6401 100644 --- a/app/models/vm_reconfigure_task.rb +++ b/app/models/vm_reconfigure_task.rb @@ -40,7 +40,7 @@ def self.build_message(options, key, message, modifier = nil) def self.build_disk_message(options) if options[:disk_add].present? - disk_sizes = options[:disk_add].collect { |d| d["disk_size_in_mb"].to_i.megabytes.to_s(:human_size) + ", Type: " + d["type"].to_s } + disk_sizes = options[:disk_add].collect { |d| d["disk_size_in_mb"].to_i.megabytes.to_fs(:human_size) + ", Type: " + d["type"].to_s } "Add Disks: #{options[:disk_add].length} : #{disk_sizes.join(", ")} " end end diff --git a/lib/acts_as_ar_model.rb b/lib/acts_as_ar_model.rb index 63eab08d8e7..bee378212ad 100644 --- a/lib/acts_as_ar_model.rb +++ b/lib/acts_as_ar_model.rb @@ -233,7 +233,7 @@ def attribute_for_inspect(attr_name) if value.kind_of?(String) && value.length > 50 "#{value[0..50]}...".inspect elsif value.kind_of?(Date) || value.kind_of?(Time) - %("#{value.to_s(:db)}") + %("#{value.to_fs(:db)}") else value.inspect end diff --git a/spec/models/vm_reconfigure_task_spec.rb b/spec/models/vm_reconfigure_task_spec.rb index e80c639534c..5d0a81b1f07 100644 --- a/spec/models/vm_reconfigure_task_spec.rb +++ b/spec/models/vm_reconfigure_task_spec.rb @@ -42,7 +42,7 @@ context "Single Disk add " do let(:request_options) { {:disk_add => [{"disk_size_in_mb" => "33", "persistent" => "true", "type" => "thin"}.with_indifferent_access]} } let(:description_partial) do - "Add Disks: 1 : #{request.options[:disk_add][0]["disk_size_in_mb"].to_i.megabytes.to_s(:human_size)}, Type: " \ + "Add Disks: 1 : #{request.options[:disk_add][0]["disk_size_in_mb"].to_i.megabytes.to_fs(:human_size)}, Type: " \ "#{request.options[:disk_add][0]["type"]} " end @@ -55,8 +55,8 @@ {"disk_size_in_mb" => "44", "persistent" => "true", "type" => "thick"}.with_indifferent_access]} end let(:description_partial) do - "Add Disks: 2 : #{request.options[:disk_add][0]["disk_size_in_mb"].to_i.megabytes.to_s(:human_size)}, Type: " \ - "#{request.options[:disk_add][0]["type"]}, #{request.options[:disk_add][1]["disk_size_in_mb"].to_i.megabytes.to_s(:human_size)}, Type: " \ + "Add Disks: 2 : #{request.options[:disk_add][0]["disk_size_in_mb"].to_i.megabytes.to_fs(:human_size)}, Type: " \ + "#{request.options[:disk_add][0]["type"]}, #{request.options[:disk_add][1]["disk_size_in_mb"].to_i.megabytes.to_fs(:human_size)}, Type: " \ "#{request.options[:disk_add][1]["type"]} " end diff --git a/spec/support/chargeback_helper.rb b/spec/support/chargeback_helper.rb index fa07d76ca3f..94beca462a0 100644 --- a/spec/support/chargeback_helper.rb +++ b/spec/support/chargeback_helper.rb @@ -40,7 +40,7 @@ def add_metric_rollups_for(resources, range, step, metric_rollup_params, trait = base_values end - record_values << "(#{values}, '#{time.to_s(:db)}')" + record_values << "(#{values}, '#{time.to_fs(:db)}')" end end