mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-05 04:03:45 +08:00
Merge pull request #7707 from aignatov-bio/ai-sci-10855-add-negative-numbers-to-stock
Add negative stock values to import [SCI-10855]
This commit is contained in:
commit
694432ffa9
1 changed files with 1 additions and 1 deletions
|
@ -167,7 +167,7 @@ class RepositoryStockValue < ApplicationRecord
|
|||
end
|
||||
|
||||
def self.import_from_text(text, attributes, _options = {})
|
||||
digit, unit = text.match(/(^\d*\.?\d*)(\D*)/).captures
|
||||
digit, unit = text.match(/(^-?\d*\.?\d*)(\D*)/).captures
|
||||
digit.strip!
|
||||
unit.strip!
|
||||
return nil if digit.blank?
|
||||
|
|
Loading…
Reference in a new issue