465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
|
# File 'lib/lockbox/model.rb', line 465
def encrypts_attached(*attributes, **options)
attributes.each do |name|
name = name.to_sym
class_eval do
@lockbox_attachments ||= {}
if @lockbox_attachments.empty?
def self.lockbox_attachments
parent_attachments =
if superclass.respond_to?(:lockbox_attachments)
superclass.lockbox_attachments
else
{}
end
parent_attachments.merge(@lockbox_attachments || {})
end
end
raise "Duplicate encrypted attachment: #{name}" if lockbox_attachments[name]
@lockbox_attachments[name] = options
end
end
end
|