SHARE
TWEET

Untitled

a guest Sep 17th, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. dut = Organization.find(61)
  2. bookings = dut.bookings.where(voyage_number: "0MQ35W1")
  3. bookings.each do |booking|
  4.   booking.containers.each do |container|
  5.     last_movement = container.previous_movement
  6.     if last_movement.gate_in? && last_movement.booking.nil?
  7.       bookings = container.bookings.where(voyage_number: "0MQ35W1")
  8.       bookings.each do |booking|
  9.         bc = booking.booking_containers.where(container_id: container.id)
  10.         bc.container_id = nil
  11.         bc.save
  12.       end
  13.     end
  14.   end
  15. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top