Git Product home page Git Product logo

Comments (9)

rterbush avatar rterbush commented on September 13, 2024

I question if there is any value to raising an error here. Perhaps we should just return nil?

cc @cmar @LBRapid

from spree_active_shipping.

mrpollo avatar mrpollo commented on September 13, 2024

@rterbush I think that would make sense but only if we handle the exception of really no methods available through any provider in @order.rate_hash in the order model here https://github.com/spree/spree/blob/1-3-stable/core/app/models/spree/order.rb#L425

else we would return either an array with nil values or an empty array by the next unless logic

does this make sense?

from spree_active_shipping.

rterbush avatar rterbush commented on September 13, 2024

Agreed. We have recently encountered this in 2.0 and are dealing with it at the moment with the following:

https://gist.github.com/rterbush/5853985

Still waiting on the seniors to weigh in on the general issue.

from spree_active_shipping.

LBRapid avatar LBRapid commented on September 13, 2024

@mrpollo I think that checking for available methods in the #rate_hash method of the Order model makes a lot of sense.

@rterbush I'm not super familiar with this extension these days but I think I understand the issue at hand and believe you are both on the right track. Let me know if you need anymore assistance.

from spree_active_shipping.

mrpollo avatar mrpollo commented on September 13, 2024

@rterbush I'm submitting fixes for Spree 1-3, do you have it fixed on Spree 2 as well? maybe we can both send the PR's

from spree_active_shipping.

rterbush avatar rterbush commented on September 13, 2024

I will follow up with PRs on 2-0-stable and master.

from spree_active_shipping.

mrpollo avatar mrpollo commented on September 13, 2024

Feedback wanted, need to raise an error inside @order.rate_hash but Spree::ShippingError i inside spree_active_shipping what should I be raising instead?

spree/spree#3268

from spree_active_shipping.

mrpollo avatar mrpollo commented on September 13, 2024

never-mind on the feedback

from spree_active_shipping.

mrpollo avatar mrpollo commented on September 13, 2024

oh wow nice, thanks!

from spree_active_shipping.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.