563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
|
# File 'lib/lockbox/model.rb', line 563
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
|