app/models/order.rb
# Group into chunks by the group_id so bundles stick together. If group_id is
# nil, it is not a bundle, so it should get its own chunk.
Group into chunks by the group_id so bundles stick together. If group_id is
nil, it is not a bundle, so it should get its own chunk.
Group into chunks by the group_id so bundles stick together . If group_id is nil it is not a bundle so it should get its own chunk .
def grouped_order_details
    sorted_order_details = order_details.sort_by(&:safe_group_id)
    sorted_order_details.slice_when do |before, after|
      before.group_id.nil? || before.group_id != after.group_id
    end
  end
def grouped_order_details sorted_order_details = order_details . sort_by ( & :safe_group_id ) sorted_order_details . slice_when do | before , after | before . group_id . nil? || before . group_id != after . group_id end end
Group into chunks by the group_id so bundles stick together.
Group into chunks by the group_id so bundles stick together .