Closed Draiken closed 7 years ago
No, you're running into a difficult problem that, fortunately, has been solved in another extension. Check the solidus_social
gem, maybe you're only one gem away from a solution to your issue.
Thanks! I'll check that out.
Meanwhile if anyone else encounters this, my solution is working: I added the module prepend to the routes file, forcing the Spree::User
to be auto loaded and prepend my additional methods before the routes are evaluated. Development reloading is working perfectly now.
I added the module prepend to the routes file, forcing the Spree::User to be auto loaded
I'm glad you got a working solution, but I'd wouldn't want to see the community adopting this strategy broadly. Adding my opinion for the record.
Which is why I opened this issue in the first place :)
If the devise modules that Spree::User
sets were configurable, simply adding :omniauthable
to that would suffice for the route generation.
Hi everyone, I've been having a few issues after adding omniauthable to the
Spree::User
class.I used a module to prepend calls to
devise
and add any necessary extra methods, the problem happens on development when classes are reloaded.I believe (haven't checked yet) that routes are reloaded before the core classes, so as soon as my routes file is read, it will setup the omniauthable routes, and load the
Spree::User
class but without my prepended module. This causes every class reload on development require a full server restart.I tried solving this by creating a
::User
class, inherit fromSpree::User
and settingSpree.user_class = "::User"
but apparentlyconstantize
thinks that meansSpree::User
:(One thing that could help would be a hook to add extra parameters to the
devise
call, which would then correctly load omniauthable even before my prepended modules.What do you guys think? Am I doing some glaring stupid mistake?