Class: PageFile
- Inherits:
-
ApplicationRecord
- Object
- ApplicationRecord
- PageFile
- Includes:
- PagesCore::Sweepable
- Defined in:
- app/models/page_file.rb
Instance Attribute Summary
Attributes included from PagesCore::Sweepable
Instance Method Summary collapse
- #attachment ⇒ Object
- #description ⇒ Object
- #filename ⇒ Object
- #format ⇒ Object
- #format? ⇒ Boolean
- #name ⇒ Object
- #to_param ⇒ Object
Instance Method Details
#attachment ⇒ Object
17 18 19 |
# File 'app/models/page_file.rb', line 17 def super&.localize!(locale) end |
#description ⇒ Object
25 26 27 |
# File 'app/models/page_file.rb', line 25 def description &.description end |
#filename ⇒ Object
29 30 31 |
# File 'app/models/page_file.rb', line 29 def filename &.filename end |
#format ⇒ Object
37 38 39 |
# File 'app/models/page_file.rb', line 37 def format &.format end |
#format? ⇒ Boolean
33 34 35 |
# File 'app/models/page_file.rb', line 33 def format? &.format? end |
#name ⇒ Object
21 22 23 |
# File 'app/models/page_file.rb', line 21 def name &.name end |
#to_param ⇒ Object
41 42 43 44 45 46 47 48 49 |
# File 'app/models/page_file.rb', line 41 def to_param return id unless if .filename_extension? "#{id}-#{.content_hash}.#{.filename_extension}" else "#{id}-#{.content_hash}" end end |