lib/lockbox/model.rb in lockbox-1.3.2 vs lib/lockbox/model.rb in lockbox-1.3.3
- old
+ new
@@ -287,9 +287,14 @@
raise "Duplicate encrypted attribute: #{original_name}" if lockbox_attributes[original_name]
raise "Multiple encrypted attributes use the same column: #{encrypted_attribute}" if lockbox_attributes.any? { |_, v| v[:encrypted_attribute] == encrypted_attribute }
@lockbox_attributes[original_name] = options
if activerecord
+ # warn on store attributes
+ if stored_attributes.any? { |k, v| v.include?(name) }
+ warn "[lockbox] WARNING: encrypting store accessors is not supported. Encrypt the column instead."
+ end
+
# warn on default attributes
if attributes_to_define_after_schema_loads.key?(name.to_s)
opt = attributes_to_define_after_schema_loads[name.to_s][1]
has_default =