Coder Social home page Coder Social logo

Comments (6)

youroff avatar youroff commented on July 21, 2024

Ok, went a little deeper. action is right, but quite inconsistent. I thought we use the route we already have, which maps last sepment to params[:state].

And everything works fine after removing this check: defined?(Spree::CheckoutController)

Any guesses why it returns nil?

from spree_auth_devise.

radar avatar radar commented on July 21, 2024

Having the check for params[:action] is right.

The defined? check would be failing because Spree::CheckoutController isn't loaded before the decorator. I just noticed this problem myself locally and fixed it up by putting this line above it:

 require 'spree/frontend_controller'

I'm in the process of fixing spree_auth_devise's test now.

from spree_auth_devise.

youroff avatar youroff commented on July 21, 2024

Why we ever need this check? Isn't it natural way to just .class_eval on any Spree's class supposing it's already there?

from spree_auth_devise.

radar avatar radar commented on July 21, 2024

If its not there then it will raise an uninitialized constant error. We must make sure to check it first.

On 25/03/2013, at 23:11, youroff [email protected] wrote:

Why we ever need this check? Isn't it natural way to just .class_eval on any Spree's class supposing it's already there?


Reply to this email directly or view it on GitHub.

from spree_auth_devise.

youroff avatar youroff commented on July 21, 2024

That's right. But if it's possible that it is not there, then this is an issue of Spree and not of this particular extension. I mean that this way of making a class extension is 100% compliant to Spree guides, right?

from spree_auth_devise.

radar avatar radar commented on July 21, 2024

It wouldn't appear if frontend gem wasn't loaded. I came to the conclusion last week that it doesn't make sense to have spree_auth_devise and not the spree_frontend gem, which means that CheckoutController will always be present and so we no longer need to do this check any more.

The issue you reported was actually caused by this check AND the absence of it loading the CheckoutController before it did this check. Removing the check means that it will fall back to ActiveSupport's const_missing (which is slow), so I've added a require_dependency which will load that class before it attempts to decorate.

This issue should now be fixed. Please let me know if it isn't.

from spree_auth_devise.

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.