Skip to content

Conditional routing#49

Merged
stewart merged 3 commits into
solidusio:masterfrom
bbuchalter:conditional-routing
Apr 25, 2016
Merged

Conditional routing#49
stewart merged 3 commits into
solidusio:masterfrom
bbuchalter:conditional-routing

Conversation

@bbuchalter

Copy link
Copy Markdown
Contributor

Steps have been taken to avoid loading certain code depending on the
presence of spree_frontend and spree_backend, but the routing was never
updated. This change conditionally loads devise routes based on the
presence of spree_frontend and spree_backend.

Also updates the syntax of routing file.

@bbuchalter

Copy link
Copy Markdown
Contributor Author

@adammathys and @stewart how does this look?

Comment thread config/routes.rb Outdated
skip: [:unlocks, :omniauth_callbacks],
path_names: { sign_out: 'logout' },
path_prefix: :user
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A small style nit - I'm never 100% sure of how to format these kinds of method calls (single-arg, then opts hash), but would prefer using an explicit hash like this:

devise_for :spree_user, {
  class_name: 'Spree::User',
  controllers: {
    sessions: 'spree/user_sessions',
    registrations: 'spree/user_registrations',
    passwords: 'spree/user_passwords',
    confirmations: 'spree/user_confirmations'
  },
  skip: [:unlocks, :omniauth_callbacks],
  path_names: { sign_out: 'logout' },
  path_prefix: :user
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've addressed this change and force pushed.

Steps have been taken to avoid loading certain code depending on the
presence of spree_frontend and spree_backend, but the routing was never
updated. This change conditionally loads devise routes based on the
presence of spree_frontend and spree_backend.
This brings the route definition syntax up to modern standards by using
the `to` option.
Eliminate the hashrockets!
@bbuchalter bbuchalter force-pushed the conditional-routing branch from 47f9839 to 1d1a60d Compare April 25, 2016 17:23
@stewart

stewart commented Apr 25, 2016

Copy link
Copy Markdown
Contributor

👍 thanks, Brian!

@stewart stewart merged commit bc74736 into solidusio:master Apr 25, 2016
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