Module: Spree::Taxon::PaperclipAttachment

Extended by:
ActiveSupport::Concern
Defined in:
app/models/spree/taxon/paperclip_attachment.rb

Instance Method Summary collapse

Instance Method Details

#attachment_partial_nameObject



22
23
24
# File 'app/models/spree/taxon/paperclip_attachment.rb', line 22

def attachment_partial_name
  'paperclip'
end

#destroy_attachment(definition) ⇒ Object



26
27
28
29
30
31
32
33
# File 'app/models/spree/taxon/paperclip_attachment.rb', line 26

def destroy_attachment(definition)
  return false unless respond_to?(definition)

  attached_file = send(definition)
  return false unless attached_file.exists?

  attached_file.destroy
end

#icon_present?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'app/models/spree/taxon/paperclip_attachment.rb', line 18

def icon_present?
  icon.present?
end