Class: Alchemy::Ingredients::File
- Inherits:
 - 
      Alchemy::Ingredient
      
        
- Object
 - ActiveRecord::Base
 - BaseRecord
 - Alchemy::Ingredient
 - Alchemy::Ingredients::File
 
 
- Defined in:
 - app/models/alchemy/ingredients/file.rb
 
Overview
A link to a file
Attach Alchemy::Attachment into this ingredient
Constant Summary
Constants included from SearchableResource
SearchableResource::SEARCHABLE_COLUMN_TYPES
Instance Method Summary collapse
- 
  
    
      #preview_text(max_length = 30)  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
The first 30 characters of the attachments name.
 
Methods inherited from Alchemy::Ingredient
allow_settings, allowed_settings, #as_view_component, #definition, #deprecated?, #has_hint?, #has_tinymce?, #has_validations?, normalize_type, #partial_name, #preview_ingredient?, related_object_alias, #settings, #to_partial_path, translated_label_for, #value
Methods included from Hints
Methods included from SearchableResource
#ransackable_associations, #ransackable_attributes, #ransortable_attributes
Instance Method Details
#preview_text(max_length = 30) ⇒ Object
The first 30 characters of the attachments name
Used by the Element#preview_text method.
      32 33 34  | 
    
      # File 'app/models/alchemy/ingredients/file.rb', line 32 def preview_text(max_length = 30) &.name.to_s[0..max_length - 1] end  |