-
-
Notifications
You must be signed in to change notification settings - Fork 393
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix meetings registrations admin form #2202
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report
@@ Coverage Diff @@
## master #2202 +/- ##
==========================================
+ Coverage 98.59% 98.59% +<.01%
==========================================
Files 1186 1186
Lines 27385 27388 +3
==========================================
+ Hits 27000 27003 +3
Misses 385 385 |
mrcasals
changed the title
Meetings/fix registrations admin form
Fix meetings registrations admin form
Nov 15, 2017
oriolgual
approved these changes
Nov 15, 2017
ghost
removed
the
in-review
label
Nov 15, 2017
mrcasals
added a commit
that referenced
this pull request
Nov 15, 2017
* Ensure admin meeting registrations form has an ID * Add CHANGNELOG entry * Add docs
Merged
mrcasals
added a commit
that referenced
this pull request
Nov 22, 2017
* Fix meetings registrations admin form (#2202) * Ensure admin meeting registrations form has an ID * Add CHANGNELOG entry * Add docs * Bump version * Bump docker image version on CircleCI * Use latest docker image (#2212) * Use alpine * Fix builds * Fix build * Fix image building * Launch CI run * Use bundle * Fix build * Fix alpine build * Bundle install * Don't cache * Try to fix build * Fix workspace persisting * Fix generator specs * Use the last released image * Use the latest image * Use the latest image to run tests * Use dev image * Add npm dependencies * Revert changes on bundle.js * Use caching * Add caching * Revert changes on the generator spec * Fix comments * Trigger build * Trigger build * Fix specs * Solve it in a different way * Fix test app generation * Migrate to headless chrome (#2157) * "main" does not depend on "test_app" * Remove unnecessary ignores * Create a testing docker image And bundle test dependencies in there. * Consistent docker arguments * Change working dir in Circle CI So that it uses the folder where decidim lives in the image. * Remove & simplify some folder changes * Migrate to headless chrome * No need to time things anymore Workflows do this for us. * Enable FAIL_FAST in CI * Remove unnecessary apt-get update Nodejs installation does it already. * Npm dependencies should be installed "in folder" So they can be used in tests without reinstalling again. * Push a test-latest image for now So that we can later add caching. * Precompile assets in test app * Use cache for test image as well * Completely ditch phantomjs & poltergeist * Fix task * Preparation for headless chrome (#2147) * Reuse shared spec * Use rack_test for specs that use lower lever stuff Since not all js drivers implement status codes and so on. * Remove unused polyfill * Explicit confirmation of modals Since not all drivers auto-accept them.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
馃帺 What? Why?
The admin meeting registrations form was not working properly when a validation error was raised and the user tried to resubmit the form. This PR ensures it works as expected.
When submitting a form without specifying the
method
(PATCH
for update orPOST
for create), Rails deduces the method it needs to use by checking if the object that is used in the form responds toto_param
. If it does and returns a significant value, then it will usePATCH
to update the resource, if it doesn't then it means we're creating the resource and thus it will usePOST
.Our form was correctly returning a significant value the first time we render the form, but if we get an error message then it wouldn't return a significant value. This is due to how we generate the form object and internals of
rectify
, the gem we're using to handle the form objects.The fix ensures the
to_param
method of the form object will always have a significant value, as it calls theid
method internally:https://github.com/andypike/rectify/blob/dd77495f6d763bd28515b44e8b00af09562e0095/lib/rectify/form.rb#L86-L88
馃搶 Related Issues