Guest User

Untitled

a guest
Apr 24th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. def by_order_production_deadline_then_customer(list)
  2. by_deadline = sort_order(:production_deadline)
  3. by_customer = sort_order(:customer_name)
  4.  
  5. list.sort do |a, b|
  6. primary_sort_order = by_deadline[a, b]
  7. secondary_sort_order = by_customer[a, b]
  8.  
  9. if primary_sort_order != 0
  10. primary_sort_order
  11. else
  12. secondary_sort_order
  13. end
  14. end
  15. end
Add Comment
Please, Sign In to add comment