Class: Comfy::Cms::File
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Comfy::Cms::File
- Includes:
- WithCategories
- Defined in:
- app/models/comfy/cms/file.rb
Constant Summary collapse
- VARIANT_SIZE =
{ redactor: {resize: "100x75^", gravity: "center", crop: "100x75+0+0"}, thumb: {resize: "200x150^", gravity: "center", crop: "200x150+0+0"}, icon: {resize: "28x28^", gravity: "center", crop: "28x28+0+0"} }
Instance Attribute Summary collapse
-
#file ⇒ Object
temporary place to store attachment.
Instance Method Summary collapse
-
#label ⇒ Object
– Instance Methods ——————————————————–.
Instance Attribute Details
#file ⇒ Object
temporary place to store attachment
13 14 15 |
# File 'app/models/comfy/cms/file.rb', line 13 def file @file end |
Instance Method Details
#label ⇒ Object
– Instance Methods ——————————————————–
35 36 37 38 39 |
# File 'app/models/comfy/cms/file.rb', line 35 def label l = read_attribute(:label) return l if l.present? .attached?? .filename.to_s : nil end |