Update syntax

This commit is contained in:
Mike Angell
2019-10-07 17:45:47 +11:00
parent a04c23eb38
commit c109615da7
2 changed files with 14 additions and 17 deletions
+2 -5
View File
@@ -423,11 +423,8 @@ module Liquid
def default(input, default_value = '', options = {})
options = {} unless options.is_a?(Hash)
if (options["allow_false"] == true ? input.nil? : !input) || (input.respond_to?(:empty?) && input.empty?)
default_value
else
input
end
false_check = options['allow_false'] ? input.nil? : !input
false_check || (input.respond_to?(:empty?) && input.empty?) ? default_value : input
end
private