Changed method to self

This commit is contained in:
Luiz F Picolo 2023-09-11 22:46:41 -04:00
parent 7dba2d6fb2
commit 085dd1c509

View File

@ -29,7 +29,7 @@ class Rate < ActiveRecord::Base
end
def self.save
results = run_speedtest
results = self.run_speedtest
if results
Rate.create({
download: results[:download],
@ -38,7 +38,7 @@ class Rate < ActiveRecord::Base
end
end
def run_speedtest
def self.run_speedtest
output = `speedtest`
if $?.success?
download_speed = output.match(/Download:\s+(\d+\.\d+)\sMbps/)[1]