mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-18 23:21:30 +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
|