Module: Spree::Taxon::PaperclipAttachment

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

Instance Method Summary collapse

Instance Method Details

#destroy_attachment(definition) ⇒ Object



22
23
24
25
26
27
28
29
# File 'app/models/spree/taxon/paperclip_attachment.rb', line 22

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

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

  attached_file.destroy && save
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