Module: ActiveStorageDedup::AttachmentOptions

Defined in:
lib/active_storage_dedup/attachment_options.rb

Instance Method Summary collapse

Instance Method Details

#has_many_attached(name, dependent: :purge_later, service: nil, strict_loading: false, deduplicate: true, **options) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/active_storage_dedup/attachment_options.rb', line 13

def has_many_attached(name, dependent: :purge_later, service: nil,
                      strict_loading: false, deduplicate: true, **options)
  ActiveStorageDedup.register_attachment(self.name, name, deduplicate: deduplicate)

  super(name, dependent: dependent, service: service,
              strict_loading: strict_loading, **options)
end

#has_one_attached(name, dependent: :purge_later, service: nil, strict_loading: false, deduplicate: true, **options) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/active_storage_dedup/attachment_options.rb', line 5

def has_one_attached(name, dependent: :purge_later, service: nil,
                     strict_loading: false, deduplicate: true, **options)
  ActiveStorageDedup.register_attachment(self.name, name, deduplicate: deduplicate)

  super(name, dependent: dependent, service: service,
              strict_loading: strict_loading, **options)
end