Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def by_order_production_deadline_then_customer(list)
- by_deadline = sort_order(:production_deadline)
- by_customer = sort_order(:customer_name)
- list.sort do |a, b|
- primary_sort_order = by_deadline[a, b]
- secondary_sort_order = by_customer[a, b]
- if primary_sort_order != 0
- primary_sort_order
- else
- secondary_sort_order
- end
- end
- end
Add Comment
Please, Sign In to add comment