Class: Locomotive::ContentAsset

Inherits:
Object
  • Object
show all
Includes:
Extensions::Asset::Types, Extensions::Asset::Vignette, Mongoid::Document
Defined in:
app/models/locomotive/content_asset.rb

Instance Method Summary collapse

Methods included from Extensions::Asset::Vignette

#vignette_url

Instance Method Details

#content_typeObject

fields ##



11
# File 'app/models/locomotive/content_asset.rb', line 11

field :content_type,  :type => String

#extnameObject



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

#siteObject

associations ##



18
# File 'app/models/locomotive/content_asset.rb', line 18

belongs_to :site, :class_name => 'Locomotive::Site'

#sourceObject

behaviours ##



21
# File 'app/models/locomotive/content_asset.rb', line 21

validates_presence_of :source

#to_liquidObject



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