diff --git a/lib/shopify_api/resources/assigned_fulfillment_order.rb b/lib/shopify_api/resources/assigned_fulfillment_order.rb index 803ab653d..dea713bcc 100644 --- a/lib/shopify_api/resources/assigned_fulfillment_order.rb +++ b/lib/shopify_api/resources/assigned_fulfillment_order.rb @@ -1,7 +1,7 @@ module ShopifyAPI class AssignedFulfillmentOrder < Base - def self.all(options = {}) - assigned_fulfillment_orders = super(options) + def self.find(scope, *args) + assigned_fulfillment_orders = super(scope, *args) assigned_fulfillment_orders.map { |afo| FulfillmentOrder.new(afo.attributes) } end end diff --git a/lib/shopify_api/resources/fulfillment_order.rb b/lib/shopify_api/resources/fulfillment_order.rb index 2a20c6dc4..bce3078aa 100644 --- a/lib/shopify_api/resources/fulfillment_order.rb +++ b/lib/shopify_api/resources/fulfillment_order.rb @@ -1,11 +1,11 @@ module ShopifyAPI class FulfillmentOrder < Base - def self.all(options = {}) - order_id = options.dig(:params, :order_id) - raise ShopifyAPI::ValidationException, "'order_id' is required" if order_id.nil? || order_id == '' + def self.find(scope, *args) + order_id = args.first&.dig(:params, :order_id) + raise ShopifyAPI::ValidationException, "'order_id' is required" if order_id.blank? order = ::ShopifyAPI::Order.new(id: order_id) - order.fulfillment_orders + order.fulfillment_orders(args.first[:params].except(:order_id)) end def fulfillments(options = {})