Class: Alchemy::EssenceFile
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Alchemy::EssenceFile
- Defined in:
- app/models/alchemy/essence_file.rb
Instance Method Summary collapse
- #attachment_url ⇒ Object
- #preview_text(max = 30) ⇒ Object
-
#serialized_ingredient ⇒ Object
Returns a serialized ingredient value for json api.
Instance Method Details
#attachment_url ⇒ Object
20 21 22 23 |
# File 'app/models/alchemy/essence_file.rb', line 20 def return if .nil? routes.(id: .id, name: .file_name) end |
#preview_text(max = 30) ⇒ Object
25 26 27 28 |
# File 'app/models/alchemy/essence_file.rb', line 25 def preview_text(max=30) return "" if .blank? .name.to_s[0..max-1] end |
#serialized_ingredient ⇒ Object
Returns a serialized ingredient value for json api
31 32 33 |
# File 'app/models/alchemy/essence_file.rb', line 31 def serialized_ingredient end |