@@ -151,8 +151,6 @@ def parse_hash_value(filter, param_value, value, operator)
151151 # JSON of
152152 # {{{ "id": 1 }}} becomes { 'id' => 1 }
153153 def parse_string_value ( filter , value )
154- return value if !!filter [ :single ]
155-
156154 type = Graphiti ::Types [ filter [ :type ] ]
157155 array_or_string = [ :string , :array ] . include? ( type [ :canonical_name ] )
158156 if ( arr = value . scan ( /\[ .*?\] / ) ) . present? && array_or_string
@@ -165,20 +163,24 @@ def parse_string_value(filter, value)
165163 }
166164 value = value [ 0 ] if value . length == 1
167165 else
168- value = parse_string_arrays ( value )
166+ value = parse_string_arrays ( value , !! filter [ :single ] )
169167 end
170168 value
171169 end
172170
173- def parse_string_arrays ( value )
171+ def parse_string_arrays ( value , singular_filter )
174172 # Find the quoted strings
175173 quotes = value . scan ( /{{.*?}}/ )
176174 # remove them from the rest
177175 quotes . each { |q | value . gsub! ( q , "" ) }
178176 # remove the quote characters from the quoted strings
179177 quotes . each { |q | q . gsub! ( "{{" , "" ) . gsub! ( "}}" , "" ) }
180178 # merge everything back together into an array
181- value = Array ( value . split ( "," ) ) + quotes
179+ if singular_filter
180+ value = Array ( value ) + quotes
181+ else
182+ value = Array ( value . split ( "," ) ) + quotes
183+ end
182184 # remove any blanks that are left
183185 value . reject! { |v | v . length . zero? }
184186 value = value [ 0 ] if value . length == 1
0 commit comments