Closed coderhs closed 7 years ago
Curious on your choice of code to fetch the old rank. As going through all the ranks seems to be unnecessary and becomes slower with the number of ranks with respect to the a website increases.
@website.ranks.each do |rank| @old_rank = rank.rank end
As you said, the process will be slower when it comes to large number of domains. so , I changed the code to
@old_rank = @website.ranks.first.rank
Curious on your choice of code to fetch the old rank. As going through all the ranks seems to be unnecessary and becomes slower with the number of ranks with respect to the a website increases.