diff options
| author | Koza <[email protected]> | 2023-09-26 11:33:36 +0200 |
|---|---|---|
| committer | Koza <[email protected]> | 2023-10-19 10:21:07 +0200 |
| commit | 964d9800117196c0494d852d84d26613c9cc89f9 (patch) | |
| tree | 155714420a73c814ebfd9d322a0fb4f06d357d80 /lib | |
| parent | 57ddee52d3208a475ba32a78f814884fd7a1cf4c (diff) | |
| download | caxlsx-964d9800117196c0494d852d84d26613c9cc89f9.tar.gz caxlsx-964d9800117196c0494d852d84d26613c9cc89f9.zip | |
Fix data validations for none type validations to show warnings only
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/axlsx/workbook/worksheet/data_validation.rb | 12 |
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 |
