mirror of
https://github.com/we-promise/sure.git
synced 2026-04-19 03:54:08 +00:00
* Reshuffle/organize settings UI * Settings: AI prompt display/minor touch-ups * API key settings tests * Moved import/export together * Collapsible LLM prompt DIVs * Add export tests
23 lines
486 B
Ruby
23 lines
486 B
Ruby
class FamilyExport < ApplicationRecord
|
|
belongs_to :family
|
|
|
|
has_one_attached :export_file, dependent: :purge_later
|
|
|
|
enum :status, {
|
|
pending: "pending",
|
|
processing: "processing",
|
|
completed: "completed",
|
|
failed: "failed"
|
|
}, default: :pending, validate: true
|
|
|
|
scope :ordered, -> { order(created_at: :desc) }
|
|
|
|
def filename
|
|
"maybe_export_#{created_at.strftime('%Y%m%d_%H%M%S')}.zip"
|
|
end
|
|
|
|
def downloadable?
|
|
completed? && export_file.attached?
|
|
end
|
|
end
|