lib/lockbox/calculations.rb in lockbox-0.4.9 vs lib/lockbox/calculations.rb in lockbox-0.5.0
- old
+ new
@@ -1,10 +1,11 @@
module Lockbox
module Calculations
def pluck(*column_names)
return super unless model.respond_to?(:lockbox_attributes)
- lockbox_columns = column_names.map.with_index { |c, i| [model.lockbox_attributes[c.to_sym], i] }.select(&:first)
+ lockbox_columns = column_names.map.with_index { |c, i| [model.lockbox_attributes[c.to_sym], i] }.select { |la, _i| la && !la[:migrating] }
+
return super unless lockbox_columns.any?
# replace column with ciphertext column
lockbox_columns.each do |la, i|
column_names[i] = la[:encrypted_attribute]