Skip to content

Commit

Permalink
Merge pull request #33 from friendlycart/better-pallet-deprecations
Browse files Browse the repository at this point in the history
Better pallet deprecations
  • Loading branch information
pelargir authored Dec 20, 2023
2 parents 34f14fc + f2fbf20 commit f8f9559
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
5 changes: 1 addition & 4 deletions lib/physical/shipment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,8 @@ def initialize(id: nil, origin: nil, destination: nil, service_code: nil, pallet
@structures = structures
@packages = packages
@options = options

return unless pallets.any?

warn "[DEPRECATION] `pallets` is deprecated. Please use `structures` instead."
@pallets = pallets
warn "[DEPRECATION] `pallets` is deprecated. Please use `structures` instead." if pallets.any?
end
end
end
1 change: 0 additions & 1 deletion lib/physical/spec_support/factories/shipment_factory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
factory :physical_shipment, class: "Physical::Shipment" do
origin { FactoryBot.build(:physical_location) }
destination { FactoryBot.build(:physical_location) }
pallets { build_list(:physical_pallet, 1) } # deprecated, will be removed
packages { build_list(:physical_package, 2) }
service_code { "usps_priority_mail" }
initialize_with { new(**attributes) }
Expand Down

0 comments on commit f8f9559

Please sign in to comment.