This file contains hidden or 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
| dut = Organization.find(61) | |
| bookings = dut.bookings.where(voyage_number: "0MQ35W1") | |
| bookings.each do |booking| | |
| booking.containers.each do |container| | |
| last_movement = container.previous_movement | |
| if last_movement.gate_in? && last_movement.booking.nil? | |
| bookings = container.bookings.where(voyage_number: "0MQ35W1") | |
| bookings.each do |booking| | |
| bc = booking.booking_containers.where(container_id: container.id) | |
| bc.container_id = nil |
This file contains hidden or 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
| can't add a new key into hash during iteration /app/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/scoping.rb:75:in | |
| `set_value_for' /app/vendor/bundle/ruby/2.4.0/gems/activesupport-4.2.8/lib/active_support/per_thread_registry.rb:50:in | |
| `set_value_for' /app/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/scoping.rb:18:in | |
| `current_scope=' /app/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/relation.rb:304:in | |
| `ensure in scoping' /app/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/relation.rb:304:in | |
| `scoping' /app/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/associations/collection_proxy.rb:874:in | |
| `scoping' /app/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/relation/delegation.rb:70 |
This file contains hidden or 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
| class Voyage | |
| def prepare_voyage(vessel) | |
| vessel.prepare | |
| end | |
| end | |
| class Vessel | |
| def prepare | |
| .. do stuff .. | |
| end |
This file contains hidden or 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
| 1. How to reset with origin | |
| git reset --hard origin/master | |
| 2. How to rebase interactively. -i | |
| 3. How to add just part of a file. | |
| 4. How to check out just a file from another branch | |
| 5. How to fix commit with ammend and -i | |
| 6. git bisect |
This file contains hidden or 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
| Consignee.all.each do |consignee| | |
| if consignee.similar_names.count >= 1 | |
| puts consignee.similar_names.count | |
| puts consignee.name | |
| puts consignee.id | |
| puts "==========================" | |
| end | |
| end |