-
-
Save siassaj/06f5332bbe3c9c3293de to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def self.hash_by_comweek_fyear(comweek=0, fyear=0) | |
orders = self.by_comweek_fyear(comweek, fyear) | |
if orders.empty? then return nil end | |
o_miny,o_maxy = orders.minmax_by(&:fyoc) | |
o_maxy.downto(o_miny).each do |y| | |
ords = orders.select { |o| o.fyoc == y } | |
unless ords.empty? | |
o_minw,o_maxw = orders.minmax_by(&:comweek) | |
o_maxw.downto(o_minw).each do |w| | |
os = ords.select { |o| o.comweek == w } | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment