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

Fix the transfer line item quantity can be negative. #4908

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nozomirin
Copy link
Contributor

Resolves #4487

Description

Only transfers are able to save negative value.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

bundle exec rspec spec/controllers/transfers_controller_spec.rb:64

Screenshots

Copy link
Collaborator

@dorner dorner left a comment

Choose a reason for hiding this comment

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

Implementation is fine, but I'd like the spec moved.

]
)
post :create, params: { transfer: attributes }
expect(flash.keys).to match_array(['error'])
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is more of a model test than a controller test. Should be moved to the model specs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK.

@nozomirin nozomirin force-pushed the 4487-fix-line-item-quantity-can-be-negative branch from 7fa75cd to 69f7e0f Compare January 3, 2025 02:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] able to enter negative values in distributions and donations. Shouldn't be able to
2 participants