From dd2499a70c56a4a2b2fc59af8e3ee7497e27b03c Mon Sep 17 00:00:00 2001 From: Martin Artnik Date: Fri, 13 Sep 2024 15:34:54 +0200 Subject: [PATCH] Fix position validation [SCI-11050] --- app/models/storage_location_repository_row.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/storage_location_repository_row.rb b/app/models/storage_location_repository_row.rb index 28f94d9da..608b7d0e9 100644 --- a/app/models/storage_location_repository_row.rb +++ b/app/models/storage_location_repository_row.rb @@ -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