Comments (6)
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.
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.
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.
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.
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.
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)
- login error devise 4.3.0 HOT 10
- Authorization failure page is rendered for not authenticated user
- Spree::Api 'checkouts#update' in production mode causes exception in Metal decorator HOT 1
- Bypass option is deprecated
- Multiple issues with specs
- Login without email impossible due to unique index on `email` column
- Devise Syntax Error HOT 2
- customize user confirmation email url HOT 1
- How can I set up the devise lockable module?
- Alerts are duplicated
- Users can't be really destroyed
- Order token is persisted on logout
- No Way For Users To Re-send The Account Confirmation Email HOT 1
- UserRegistrationsController won't inherit from Spree::BaseController
- 2-Factor Authentication HOT 2
- ArgumentError:wrong number of arguments (given 0, expected 1) on Spree::User#send_confirmation_instructions (spree_auth_devise 4.3.0) HOT 6
- Spree backend user session fallback root path is not admin_path
- Uninitialized constant Spree::UsersController with spree legacy frontend HOT 2
- 4.5.0 breaks rails version resolution (bundler) HOT 1
- URL Generation issue after Admin login HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spree_auth_devise.