Class: Kuhsaft::Asset
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Kuhsaft::Asset
- Defined in:
- app/models/kuhsaft/asset.rb
Instance Method Summary collapse
Instance Method Details
#file_type ⇒ Object
5 6 7 8 9 |
# File 'app/models/kuhsaft/asset.rb', line 5 def file_type if file.path.present? && ext = File.extname(file.path).split('.').last ext.to_sym unless ext.blank? end end |
#filename ⇒ Object
23 24 25 |
# File 'app/models/kuhsaft/asset.rb', line 23 def filename try(:file).try(:file).try(:filename) end |
#name ⇒ Object
11 12 13 |
# File 'app/models/kuhsaft/asset.rb', line 11 def name File.basename(file.path) if file.present? && file.path.present? end |
#path ⇒ Object
15 16 17 |
# File 'app/models/kuhsaft/asset.rb', line 15 def path file.url end |
#path=(val) ⇒ Object
19 20 21 |
# File 'app/models/kuhsaft/asset.rb', line 19 def path=val # do nothing end |