Module: Pageflow::HostedFile
- Extended by:
- ActiveSupport::Concern
- Includes:
- UploadedFile
- Defined in:
- app/models/concerns/pageflow/hosted_file.rb
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
- #attachment ⇒ Object
- #attachment=(value) ⇒ Object
- #keep_on_filesystem_after_upload_to_s3? ⇒ Boolean
- #original_url ⇒ Object
- #retryable? ⇒ Boolean
- #url ⇒ Object
Methods included from UploadedFile
Class Method Details
.columns(t) ⇒ Object
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'app/models/concerns/pageflow/hosted_file.rb', line 66 def self.columns(t) t.belongs_to(:entry, index: true) t.belongs_to(:uploader, index: true) t.string(:state) t.string(:rights) t.string(:attachment_on_filesystem_file_name) t.string(:attachment_on_filesystem_content_type) t.integer(:attachment_on_filesystem_file_size, limit: 8) t.datetime(:attachment_on_filesystem_updated_at) t.string(:attachment_on_s3_file_name) t.string(:attachment_on_s3_content_type) t.integer(:attachment_on_s3_file_size, limit: 8) t.datetime(:attachment_on_s3_updated_at) t. end |
Instance Method Details
#attachment ⇒ Object
40 41 42 |
# File 'app/models/concerns/pageflow/hosted_file.rb', line 40 def .present? ? : end |
#attachment=(value) ⇒ Object
44 45 46 |
# File 'app/models/concerns/pageflow/hosted_file.rb', line 44 def (value) self. = value end |
#keep_on_filesystem_after_upload_to_s3? ⇒ Boolean
48 49 50 |
# File 'app/models/concerns/pageflow/hosted_file.rb', line 48 def keep_on_filesystem_after_upload_to_s3? false end |
#original_url ⇒ Object
62 63 64 |
# File 'app/models/concerns/pageflow/hosted_file.rb', line 62 def original_url url end |
#retryable? ⇒ Boolean
52 53 54 |
# File 'app/models/concerns/pageflow/hosted_file.rb', line 52 def retryable? can_retry? end |
#url ⇒ Object
56 57 58 59 60 |
# File 'app/models/concerns/pageflow/hosted_file.rb', line 56 def url if .present? .url end end |