Class: QcFile
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- QcFile
- Extended by:
- DbFile::Uploader
- Includes:
- Uuid::Uuidable
- Defined in:
- app/models/qc_file.rb
Defined Under Namespace
Modules: Associations
Instance Method Summary collapse
-
#current_data ⇒ Object
Method provided for backwards compatibility.
- #retrieve_file {|uploaded_data| ... } ⇒ Object
Methods included from DbFile::Uploader
Methods included from Uuid::Uuidable
included, #unsaved_uuid!, #uuid
Methods inherited from ApplicationRecord
alias_association, convert_labware_to_receptacle_for, find_by_id_or_name, find_by_id_or_name!
Methods included from Squishify
Instance Method Details
#current_data ⇒ Object
Method provided for backwards compatibility
42 43 44 |
# File 'app/models/qc_file.rb', line 42 def current_data uploaded_data.read end |
#retrieve_file {|uploaded_data| ... } ⇒ Object
46 47 48 49 50 51 52 53 54 55 |
# File 'app/models/qc_file.rb', line 46 def retrieve_file uploaded_data.cache!(uploaded_data.file) yield(uploaded_data) # We can't actually delete the cache file here, as the send_file # operation happens asynchronously. Instead we can use: # PolymorphicUploader.clean_cached_files! # This cleans the last 24h worth of files, so should be a daily # cron end |