mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-09-20 06:35:56 +08:00
Fix position validation [SCI-11050]
This commit is contained in:
parent
ddc7cf9bf6
commit
dd2499a70c
|
@ -29,7 +29,7 @@ class StorageLocationRepositoryRow < ApplicationRecord
|
|||
|
||||
def ensure_uniq_position
|
||||
if storage_location.storage_location_repository_rows
|
||||
.where("metadata->>'position' = ?", metadata['position'].to_json.gsub(',', ', '))
|
||||
.where("metadata->'position' = ?", metadata['position'].to_json)
|
||||
.where.not(id: id).exists?
|
||||
errors.add(:base, I18n.t('activerecord.errors.models.storage_location.not_uniq_position'))
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue