mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-31 04:32:06 +08:00
13 lines
303 B
Ruby
13 lines
303 B
Ruby
class TempFile < ApplicationRecord
|
|
validates :session_id, presence: true
|
|
|
|
has_attached_file :file
|
|
do_not_validate_attachment_file_type :file
|
|
|
|
def destroy_obsolete
|
|
destroy! if self
|
|
end
|
|
|
|
handle_asynchronously :destroy_obsolete,
|
|
run_at: proc { 7.days.from_now }
|
|
end
|