I have the following code:
def maturities
InfoItem.find_all_by_work_order(self.work_order).map(&:maturity)
end
I was thinking about changing it to:
def maturities
InfoItem.where(work_order: self.work_order).map(&:maturity)
end
Would there be any advantage to this? It seems like .where
is more common than find_all_by
nowadays.