mirror of
https://github.com/docusealco/docuseal
synced 2026-11-04 14:42:32 -05:00
don't raise validation error if the message is empty
This commit is contained in:
1 parent
15d06f4fb0
commit
bb552d13d4
3 files changed
+34
-2
No files matched your search
@@ -89,12 +89,13 @@ module Params
|
||||
raise_error(message || "#{key} must be unique")
|
||||
end
|
||||
|
||||
def in_path(params, path = [])
|
||||
def in_path(params, path = [], skip_blank: false)
|
||||
old_path = @current_path
|
||||
|
||||
@current_path = [old_path, *path].compact_blank.map(&:to_s).join('.')
|
||||
|
||||
param = params.dig(*path)
|
||||
param = nil if skip_blank && param.blank?
|
||||
|
||||
yield params.dig(*path) if param
|
||||
|
||||
|
||||
Reference in new issue
Block a user