Class: Postablr::Entry::Audio
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Postablr::Entry::Audio
- Defined in:
- app/models/postablr/entry/audio.rb
Instance Attribute Summary collapse
-
#content_type ⇒ Object
Returns the value of attribute content_type.
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#size ⇒ Object
Returns the value of attribute size.
Instance Method Summary collapse
- #audio_title ⇒ Object
-
#path=(value) ⇒ Object
validates_presence_of :title.
Instance Attribute Details
#content_type ⇒ Object
Returns the value of attribute content_type.
7 8 9 |
# File 'app/models/postablr/entry/audio.rb', line 7 def content_type @content_type end |
#filename ⇒ Object
Returns the value of attribute filename.
7 8 9 |
# File 'app/models/postablr/entry/audio.rb', line 7 def filename @filename end |
#size ⇒ Object
Returns the value of attribute size.
7 8 9 |
# File 'app/models/postablr/entry/audio.rb', line 7 def size @size end |
Instance Method Details
#audio_title ⇒ Object
19 20 21 |
# File 'app/models/postablr/entry/audio.rb', line 19 def audio_title title.blank? ? File.basename( file.url ) : title end |
#path=(value) ⇒ Object
validates_presence_of :title
11 12 13 14 15 16 17 |
# File 'app/models/postablr/entry/audio.rb', line 11 def path=(value) logger.info value uploaded_file = CarrierWave::SanitizedFile.new :tempfile => value, :filename => filename, :content_type => content_type self.file = uploaded_file end |