lib/fleximage/model.rb
# Delete the image file for this record. This is automatically ran after this record gets 
# destroyed, but you can call it manually if you want to remove the image from the record.
Delete the image file for this record. This is automatically ran after this record gets
destroyed, but you can call it manually if you want to remove the image from the record.
Delete the image file for this record . This is automatically ran after this record gets destroyed but you can call it manually if you want to remove the image from the record .
def delete_image_file
        return unless self.class.has_store?
        if self.class.db_store?
          update_attribute :image_file_data, nil unless frozen?
        elsif self.class.s3_store?
          AWS::S3::S3Object.delete "#{id}.#{self.class.image_storage_format}", self.class.s3_bucket
        else
          File.delete(file_path) if File.exists?(file_path)
        end
        clear_magic_attributes
        self
      end
def delete_image_file return unless self . class . has_store? if self . class . db_store? update_attribute :image_file_data , nil unless frozen? elsif self . class . s3_store? AWS :: S3 :: S3Object . delete "#{id}.#{self.class.image_storage_format}" , self . class . s3_bucket else File . delete ( file_path ) if File . exists? ( file_path ) end clear_magic_attributes self end
Delete the image file for this record.
Delete the image file for this record .