Class: DraftUpload

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/drafter/draft_upload.rb

Overview

Some of the objects we want to keep drafts of will have attached uploads, which are stored using CarrierWave. The simplest thing which can work, I think, is to grab the uploaded data from the draftable object, and store it in its own class, making a note of the original mount column that the file was destined for.

The original :file_data is saved in this model, without any processing or modification. When the draft is approved, the Draft will push the :file_data onto the :draftable_mount_column of the draftable object.