Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Spree::Auth::Engine #56

Merged
merged 4 commits into from
Jun 16, 2016
Merged

Refactor Spree::Auth::Engine #56

merged 4 commits into from
Jun 16, 2016

Conversation

stewart
Copy link
Contributor

@stewart stewart commented Jun 1, 2016

A handful of small refactorings to Spree::Auth::Engine. The code in here was not amazing, I've attempted to simplify it where possible.

stewart added 4 commits May 27, 2016 15:38
These methods are used to determine if an engine/gem is available, by
checking all currently-registered Rails::Engine subclasses. This code
had gone through several iterations, and was now overly complex,
redundant, and difficult to read.
Simplifies config.to_prepare call for Spree::Auth::Engine. Previous
version made use of `&method`, and was confusing to new viewers of this
file. The contents of Spree::Auth::Engine.activate have been pulled out
into the new methods `prepare_backend` and `prepare_frontend`. These add
assets, load decorator classes, and set up redirects as necessary,
depending on whether or not the related Solidus gem is available.
Since we're invoking these methods in the same context that they're
defined, we don't need to prefix the calls with an identifier.
A small fix, but brings code more in-line with modern Ruby style
recommendations.
@bbuchalter
Copy link
Contributor

This looks good to me. Thanks @stewart. 👍

@stewart stewart merged commit d182cda into master Jun 16, 2016
@stewart stewart deleted the refactor/engine branch June 16, 2016 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants