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

Added Api::Utils.resource_search_by_href_slug helper method #14443

Merged
merged 2 commits into from
Mar 27, 2017

Conversation

abellotti
Copy link
Member

  • Added Api::Utils.resource_search_by_href_slug helper method
  • Added related rspec

@abellotti
Copy link
Member Author

/cc @Fryguy @mkanoor @gmcculloug as promised, please review. Thanks.

@gmcculloug
Copy link
Member

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)
Copy link
Contributor

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)

Copy link
Member Author

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. 👍

@abellotti abellotti force-pushed the api_resource_search_by_href_slug branch from ae4ce20 to d5eddfd Compare March 22, 2017 15:27
User.current_user or specified user must be specified
Updated tests for the new signature
@abellotti abellotti force-pushed the api_resource_search_by_href_slug branch from d5eddfd to d727f00 Compare March 22, 2017 15:28
@abellotti
Copy link
Member Author

@mkanoor updated as discussed. Thanks!!

@miq-bot
Copy link
Member

miq-bot commented Mar 22, 2017

Checked commits abellotti/manageiq@2c618ab~...d727f00 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
2 files checked, 0 offenses detected
Everything looks good. 🏆

@mkanoor
Copy link
Contributor

mkanoor commented Mar 22, 2017

👍

@abellotti
Copy link
Member Author

anything else needed here ? can this be merged ?

Copy link
Member

@gtanzillo gtanzillo left a comment

Choose a reason for hiding this comment

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

👍

@gtanzillo gtanzillo merged commit 168690d into ManageIQ:master Mar 27, 2017
@gtanzillo gtanzillo added this to the Sprint 57 Ending Mar 27, 2017 milestone Mar 27, 2017
@abellotti abellotti deleted the api_resource_search_by_href_slug branch April 11, 2017 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants