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

[API] Add bang method when finding product property #3528

Merged

Conversation

SamuelMartini
Copy link
Contributor

Description
If the controller does not find the product property it cannot return an invalid resource response for that record and then it breaks with 500.
This commit adds the bang method so that the controller can rely on the base controller rescue_from ActiveRecord::RecordNotFound to return a proper message.

Checklist:

  • I have followed Pull Request guidelines
  • I have added a detailed description into each commit message
  • I have added tests to cover this change (if needed)

If the controller does not find the product property it cannot return an invalid
resource response for that record and then it breaks with 500.
This commit adds the bang method so that the controller can rely on the base
controller rescue_from ActiveRecord::RecordNotFound
https://github.com/solidusio/solidus/blob/v2.10.0/api/app/controllers/spree/api/base_controller.rb#L28
to return a proper message.
@kennyadsl kennyadsl changed the title Add bang method when finding product property [API] Add bang method when finding product property Feb 28, 2020
Copy link
Member

@kennyadsl kennyadsl left a comment

Choose a reason for hiding this comment

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

Thanks Sam!

@kennyadsl kennyadsl added Code Review Needed changelog:solidus_api Changes to the solidus_api gem labels Mar 3, 2020
Copy link
Member

@spaghetticode spaghetticode left a comment

Choose a reason for hiding this comment

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

@SamuelMartini thank you 🌮

@kennyadsl kennyadsl merged commit c165e2d into solidusio:master Mar 6, 2020
@kennyadsl kennyadsl deleted the SamuelMartini/product_property_api branch March 6, 2020 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:solidus_api Changes to the solidus_api gem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants