Class: Locomotive::ContentAsset
- Inherits:
-
Object
- Object
- Locomotive::ContentAsset
- Defined in:
- app/models/locomotive/content_asset.rb
Instance Method Summary collapse
-
#content_type ⇒ Object
fields ##.
- #extname ⇒ Object
-
#site ⇒ Object
associations ##.
-
#source ⇒ Object
behaviours ##.
- #to_liquid ⇒ Object
Methods included from Extensions::Asset::Vignette
Instance Method Details
#content_type ⇒ Object
fields ##
11 |
# File 'app/models/locomotive/content_asset.rb', line 11 field :content_type, :type => String |
#extname ⇒ Object
30 31 32 33 |
# File 'app/models/locomotive/content_asset.rb', line 30 def extname return nil unless self.source? File.extname(self.source_filename).gsub(/^\./, '') end |
#site ⇒ Object
associations ##
18 |
# File 'app/models/locomotive/content_asset.rb', line 18 belongs_to :site, :class_name => 'Locomotive::Site' |
#source ⇒ Object
behaviours ##
21 |
# File 'app/models/locomotive/content_asset.rb', line 21 validates_presence_of :source |
#to_liquid ⇒ Object
35 36 37 |
# File 'app/models/locomotive/content_asset.rb', line 35 def to_liquid { :url => self.source.url }.merge(self.attributes).stringify_keys end |