-
Notifications
You must be signed in to change notification settings - Fork 143
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
Use Rails path helpers for all routes #40
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
imtayadeway
force-pushed
the
url-helpers-ii
branch
2 times, most recently
from
August 31, 2017 17:22
6d08099
to
3f48831
Compare
This pull request is not mergeable. Please rebase and repush. |
@imtayadeway ❤️ this PR. Can you resolve the conflicts/repush ? Thanks. |
imtayadeway
force-pushed
the
url-helpers-ii
branch
from
September 7, 2017 15:40
3f48831
to
c4d0085
Compare
imtayadeway
force-pushed
the
url-helpers-ii
branch
from
September 7, 2017 16:02
c4d0085
to
15763b2
Compare
This enables us to: * delete the custom metaprogramming in api_helper.rb which offered a similar but limited implementation. * take advantage of the default behavior when passed an object which is to form a URL from the object's id, meaning the id can be omitted for terseness. * avoid having to do fuzzy matching when comparing hrefs, because where our methods provided only the path, Rails' gives us the full URL * avoid doing our own string concatenation for subcollection routes, e.g.: ```ruby # before "#{blueprints_url(blueprint.id)}/tags/#{tag.id}" # after api_blueprint_tag_url(nil, blueprint, tag) * possibly leverage some of these helpers on the production side
imtayadeway
force-pushed
the
url-helpers-ii
branch
from
September 7, 2017 16:22
15763b2
to
2c1bdc4
Compare
Checked commit imtayadeway@2c1bdc4 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
Looks good to me, Thanks @imtayadeway for this refactoring !! 🎼 |
This was referenced Sep 7, 2017
Merged
imtayadeway
added a commit
to imtayadeway/manageiq-api
that referenced
this pull request
Sep 7, 2017
This went red with the collision of ManageIQ#38 and ManageIQ#40 - updated to use the new helper.
alexander-demicev
pushed a commit
to alexander-demicev/manageiq-api
that referenced
this pull request
Oct 5, 2017
This went red with the collision of ManageIQ#38 and ManageIQ#40 - updated to use the new helper.
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.
Follow up to #23
This enables us to:
similar but limited implementation.
is to form a URL from the object's id, meaning the id can be omitted
for terseness.
where our methods provided only the path, Rails' gives us the full
URL
e.g.:
This won't stay fresh for long, so ask me to rebase prior to merging.
@miq-bot add-label test, technical debt
@miq-bot assign @abellotti