lib/sequel/plugins/validation_helpers.rb in sequel-4.15.0 vs lib/sequel/plugins/validation_helpers.rb in sequel-4.16.0

- old
+ new

@@ -239,10 +239,13 @@ vals = arr.map{|x| send(x)} next if vals.any?{|v| v.nil?} ds.where(arr.zip(vals)) end ds = yield(ds) if block_given? - ds = ds.exclude(pk_hash) unless new? + unless new? + h = ds.joined_dataset? ? qualified_pk_hash : pk_hash + ds = ds.exclude(h) + end errors.add(a, message) unless ds.count == 0 end end private