Class: Attachment
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Attachment
show all
- Defined in:
- app/models/attachment.rb
Instance Method Summary
collapse
Instance Method Details
#file_type ⇒ Object
29
30
31
|
# File 'app/models/attachment.rb', line 29
def file_type
content_type.split('/').last
end
|
#fill_blank_name_with_filename ⇒ Object
33
34
35
36
37
|
# File 'app/models/attachment.rb', line 33
def fill_blank_name_with_filename
if name.blank? and filename
self.name = filename.split('.').first
end
end
|