lib/cassanity/argument_generators/with_clause.rb in cassanity-0.3.0 vs lib/cassanity/argument_generators/with_clause.rb in cassanity-0.4.0

- old
+ new

@@ -10,17 +10,23 @@ return [cql] if with.nil? || with.empty? variables, withs = [], [] with.each do |key, value| - if value.is_a?(Hash) - value.each do |sub_key, sub_value| - withs << "#{key}:#{sub_key} = ?" - variables << sub_value + if key == :compact_storage + if value + withs << "COMPACT STORAGE" end else - withs << "#{key} = ?" - variables << value + if value.is_a?(Hash) + value.each do |sub_key, sub_value| + withs << "#{key}:#{sub_key} = ?" + variables << sub_value + end + else + withs << "#{key} = ?" + variables << value + end end end cql << " WITH #{withs.join(' AND ')}"