Class: Decidim::PrivateExport
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Decidim::PrivateExport
- Defined in:
- app/models/decidim/private_export.rb
Instance Method Summary collapse
- #expired? ⇒ Boolean
- #private_download_authorized?(user, requested_attachment_name) ⇒ Boolean
- #set_content_type_and_size ⇒ Object
Instance Method Details
#expired? ⇒ Boolean
19 20 21 |
# File 'app/models/decidim/private_export.rb', line 19 def expired? expires_at < Time.zone.now end |
#private_download_authorized?(user, requested_attachment_name) ⇒ Boolean
28 29 30 31 32 |
# File 'app/models/decidim/private_export.rb', line 28 def (user, ) return false unless .to_s == "file" attached_to == user end |
#set_content_type_and_size ⇒ Object
23 24 25 26 |
# File 'app/models/decidim/private_export.rb', line 23 def set_content_type_and_size self.content_type = file.content_type self.file_size = file.byte_size end |