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

Different behavior with optional parameters #274

Closed
pustovalov opened this issue May 21, 2021 · 1 comment
Closed

Different behavior with optional parameters #274

pustovalov opened this issue May 21, 2021 · 1 comment

Comments

@pustovalov
Copy link
Contributor

routes.rb

resources :campaigns, except: [:index, :update, :destroy], path: '(/:space)/campaigns', space: ALLOWED_PRODUCT_SPACES_REGEXP, defaults: {space: nil} do

1.4.14

Routes.site_campaign_path('test', 'loyalty', 1)
"/sites/test/loyalty/campaigns/1"

Routes.site_campaign_path('test', '', 1)
"/sites/test/campaigns/1"

Routes.site_campaign_path('test', false, 1)
"/sites/test/campaigns/1" //diff

2.0.0 and 2.0.1

Routes.site_campaign_path('test', 'loyalty', 1)
"/sites/test/loyalty/campaigns/1"

Routes.site_campaign_path('test', '', 1)
"/sites/test/campaigns/1"

Routes.site_campaign_path('test', false, 1)
"/sites/test/false/campaigns/1" //diff

Is this the expected behavior?

@bogdan
Copy link
Collaborator

bogdan commented May 24, 2021

I've fixed that. The problem is tricky though because rails itself has problems with it: rails/rails#42280

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

No branches or pull requests

2 participants