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

[v2.8] Backport for some required bugfixes #3194

Merged

Conversation

kennyadsl
Copy link
Member

@kennyadsl kennyadsl commented Apr 30, 2019

This PR is a backport into v2.8 of:

A new 2.8.x patch version will be released after we merge this.

The form controls to submit the stock item form was not
displayed if only the backorder checkbox changed.
@kennyadsl kennyadsl added the type:bug Error, flaw or fault label Apr 30, 2019
@kennyadsl kennyadsl self-assigned this Apr 30, 2019
According to the `sassc` compiler, all CSS functions should ensure that
they do not end without a `@return` statement. The `very-light` function
has the possibility that it could exit without calling such a statement,
so we add a catchall `@return` at the end to return the unmodified color
value.
@kennyadsl kennyadsl changed the title [v2.8] Fix stock item form to allow changing backorder value [v2.8] Backport for some required bugfixes Jun 11, 2019
We already had this but with the last version of discard the validation
is no more performing.

I think it's something related to this commit
jhawthorn/discard@dfdd984
which is included in the last release.

Before the release, calling discarded? on the line:

validate :validate_no_amount_used, if: :discarded?

was returning true, even if the record change wasn't yet persisted. We
don't need that line anymore since now records can't be discarded
without passing the after_discard validation so we should not have any of
those. Anyway, even if that happens we don't want to block other updates
on those records.
This is needed to avoid discard to set deleted_at anyway.

Now that we are not running this method as a validation anymore we need
to stop the callback chain by throwing abort, see:

https://api.rubyonrails.org/classes/ActiveModel/Callbacks.html
Copy link
Contributor

@ericsaupe ericsaupe left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@jacobherrington jacobherrington left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@kennyadsl kennyadsl merged commit eef4da8 into solidusio:v2.8 Jun 11, 2019
@kennyadsl kennyadsl deleted the kennyadsl/fix-stock-backordered-v2.8 branch June 11, 2019 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Error, flaw or fault
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants