mirror of
https://github.com/we-promise/sure.git
synced 2026-04-07 14:31:25 +00:00
* Replace Maybe for Sure in select code areas * Make sure passwords are consistent * Remove (admin|member) from demo data first name * Database and schema names finally to `sure` * Fix broken test * Another (benchmarking) database name to `sure_*` * More rebranding to Sure * Missed this Maybe mention in the same page * Random nitpicks and more Maybes * Demo data accounts and more Maybes * Test data account updates * Impersonation test accounts * Consistency with `compose.example.yml`
23 lines
485 B
Ruby
23 lines
485 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
|
|
"sure_export_#{created_at.strftime('%Y%m%d_%H%M%S')}.zip"
|
|
end
|
|
|
|
def downloadable?
|
|
completed? && export_file.attached?
|
|
end
|
|
end
|