lib/blind_index/model.rb in blind_index-0.2.1 vs lib/blind_index/model.rb in blind_index-0.3.0

- old
+ new

@@ -1,8 +1,8 @@ module BlindIndex module Model - def blind_index(name, key: nil, iterations: nil, attribute: nil, expression: nil, bidx_attribute: nil, callback: true) + def blind_index(name, key: nil, iterations: nil, attribute: nil, expression: nil, bidx_attribute: nil, callback: true, algorithm: nil, insecure_key: nil, encode: nil) iterations ||= 10000 attribute ||= name bidx_attribute ||= :"encrypted_#{name}_bidx" name = name.to_sym @@ -21,11 +21,14 @@ blind_indexes[name] = { key: key, iterations: iterations, attribute: attribute, expression: expression, - bidx_attribute: bidx_attribute - } + bidx_attribute: bidx_attribute, + algorithm: algorithm, + insecure_key: insecure_key, + encode: encode + }.reject { |_, v| v.nil? } define_singleton_method method_name do |value| BlindIndex.generate_bidx(value, blind_indexes[name]) end