Class: Humpyard::Assets::PaperclipAsset
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Humpyard::Assets::PaperclipAsset
- Defined in:
- app/models/humpyard/assets/paperclip_asset.rb
Instance Method Summary collapse
Instance Method Details
#content_type ⇒ Object
32 33 34 |
# File 'app/models/humpyard/assets/paperclip_asset.rb', line 32 def content_type media_content_type end |
#title ⇒ Object
24 25 26 |
# File 'app/models/humpyard/assets/paperclip_asset.rb', line 24 def title media_file_name end |
#update_media_dimensions ⇒ Object
36 37 38 39 40 41 42 43 44 45 |
# File 'app/models/humpyard/assets/paperclip_asset.rb', line 36 def update_media_dimensions begin size = Paperclip::Geometry.from_file media.queued_for_write[:original] asset.width = size.width.to_i asset.height = size.height.to_i rescue asset.width = nil asset.height = nil end end |
#url ⇒ Object
28 29 30 |
# File 'app/models/humpyard/assets/paperclip_asset.rb', line 28 def url media.url end |