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

Fix problem with misssing params in schedules controller #4953

Merged
merged 1 commit into from
Mar 12, 2020

Conversation

luisramos0
Copy link
Contributor

@luisramos0 luisramos0 commented Mar 9, 2020

What? Why?

Closes #4943

This is hack to fix the problem described in #4943
I dont know the existing mechanism (working in master) that copies params like params[:name] into params[:schedule] becoming params[:schedule][:name]
My best hypothesis is that this mechanism is not working for order_cycle_ids because it is an HABTM association in Schedule and not a basic attribute or a has_many association.

What should we test?

green specs in 4943

@luisramos0 luisramos0 self-assigned this Mar 9, 2020
Copy link
Contributor

@sauloperez sauloperez left a comment

Choose a reason for hiding this comment

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

Fine for me but, have you checked how the form is rendered now? could be a change in the way the form gets rendered by Rails because of what you point out regarding the association. It'd be great if we could investigate a bit more to avoid adding the hack. It can happen in a separate PR.

@luisramos0
Copy link
Contributor Author

I did check the form, it works exactly the same and send exactly the same data to the server. the difference is only at the route/controller level.

@sauloperez sauloperez merged commit 62c35ef into openfoodfoundation:3-0-stable Mar 12, 2020
@luisramos0 luisramos0 deleted the sch_fix branch March 12, 2020 16:41
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