-
Notifications
You must be signed in to change notification settings - Fork 898
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
Added Api::Utils.resource_search_by_href_slug helper method #14443
Added Api::Utils.resource_search_by_href_slug helper method #14443
Conversation
abellotti
commented
Mar 21, 2017
- Added Api::Utils.resource_search_by_href_slug helper method
- Added related rspec
Added related rspec
/cc @Fryguy @mkanoor @gmcculloug as promised, please review. Thanks. |
Easily my second favorite href_slug related PR of the day. 😃 Thanks for getting this out. 👍 |
lib/api/utils.rb
Outdated
@@ -5,5 +5,15 @@ def self.build_href_slug(klass, id) | |||
collection = Api::CollectionConfig.new.name_for_subclass(klass) | |||
"#{collection}/#{id}" if collection | |||
end | |||
|
|||
def self.resource_search_by_href_slug(href_slug) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@abellotti can we pass in the user_object here with the default being User.curent_user
def self.resource_search_by_href(href_slug, user = User.current_user)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, didn't know the usage from your side. Will update. 👍
ae4ce20
to
d5eddfd
Compare
User.current_user or specified user must be specified Updated tests for the new signature
d5eddfd
to
d727f00
Compare
@mkanoor updated as discussed. Thanks!! |
Checked commits abellotti/manageiq@2c618ab~...d727f00 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
👍 |
anything else needed here ? can this be merged ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍