Class: Para::Library::File
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Para::Library::File
- Defined in:
- app/models/para/library/file.rb
Instance Method Summary collapse
- #attachment_ext ⇒ Object
-
#attachment_path ⇒ Object
Return attachment.path or attachment.url depending on the storage backend, allowing ‘openuri’ and ‘roo’ libraries to load easily the file at the right path, on filesystem or othe storage systems, like S3.
-
#attachment_url ⇒ Object
Return attachment.path or attachment.url depending on the storage backend, allowing ‘openuri’ and ‘roo’ libraries to load easily the file at the right path, on filesystem or othe storage systems, like S3.
Methods inherited from ApplicationRecord
with_belongs_to_optional_option_if_needed
Instance Method Details
#attachment_ext ⇒ Object
19 20 21 |
# File 'app/models/para/library/file.rb', line 19 def ::File.extname(.filename.to_s) if .attached? end |
#attachment_path ⇒ Object
Return attachment.path or attachment.url depending on the storage backend, allowing ‘openuri’ and ‘roo’ libraries to load easily the file at the right path, on filesystem or othe storage systems, like S3.
11 12 13 14 15 |
# File 'app/models/para/library/file.rb', line 11 def return unless .attached? .url end |
#attachment_url ⇒ Object
Return attachment.path or attachment.url depending on the storage backend, allowing ‘openuri’ and ‘roo’ libraries to load easily the file at the right path, on filesystem or othe storage systems, like S3.
17 18 19 20 21 |
# File 'app/models/para/library/file.rb', line 17 def return unless .attached? .url end |