summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/workbook
diff options
context:
space:
mode:
authorZsolt Kozaroczy <[email protected]>2023-10-19 10:22:48 +0200
committerGitHub <[email protected]>2023-10-19 10:22:48 +0200
commitf6cb47c8baa99487610471d74da6a87b1232f336 (patch)
tree155714420a73c814ebfd9d322a0fb4f06d357d80 /lib/axlsx/workbook
parent57ddee52d3208a475ba32a78f814884fd7a1cf4c (diff)
parent964d9800117196c0494d852d84d26613c9cc89f9 (diff)
downloadcaxlsx-f6cb47c8baa99487610471d74da6a87b1232f336.tar.gz
caxlsx-f6cb47c8baa99487610471d74da6a87b1232f336.zip
Merge pull request #304 from kiskoza/fix-none-type-validations
Fix data validations for none type validations to show warnings only
Diffstat (limited to 'lib/axlsx/workbook')
-rw-r--r--lib/axlsx/workbook/worksheet/data_validation.rb12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/axlsx/workbook/worksheet/data_validation.rb b/lib/axlsx/workbook/worksheet/data_validation.rb
index a84ab84d..a9e7ea9f 100644
--- a/lib/axlsx/workbook/worksheet/data_validation.rb
+++ b/lib/axlsx/workbook/worksheet/data_validation.rb
@@ -254,17 +254,15 @@ module Axlsx
attributes = [:allowBlank, :error, :errorStyle, :errorTitle, :prompt, :promptTitle, :showErrorMessage, :showInputMessage, :sqref, :type]
if [:whole, :decimal, :data, :time, :date, :textLength].include?(@type)
- attributes << [:operator, :formula1]
- attributes << [:formula2] if [:between, :notBetween].include?(@operator)
+ attributes << :operator << :formula1
+ attributes << :formula2 if [:between, :notBetween].include?(@operator)
elsif @type == :list
- attributes << [:showDropDown, :formula1]
+ attributes << :showDropDown << :formula1
elsif @type == :custom
- attributes << [:formula1]
- else
- attributes = []
+ attributes << :formula1
end
- attributes.flatten!
+ attributes
end
end
end