Sha256: cf3d27724e5d74bf51cc569501858acf862723cd044e5a7d4e503270bf3284e3
Contents?: true
Size: 566 Bytes
Versions: 250
Compression:
Stored size: 566 Bytes
Contents
class Caboose::Asset < ActiveRecord::Base self.table_name = "assets" belongs_to :page attr_accessible :page_id, :uploaded_by_id, :date_uploaded, :name, :filename, :description, :extension def sanitize_name(str) return str.gsub(' ', '_').downcase end def assets_with_uri(uri) uri[0] = '' if uri.start_with? '/' page = Page.page_with_uri(File.dirname(uri), false) return false if page.nil? asset = Asset.where(:page_id => page.id,:filename => File.basename(uri)).first return false if asset.nil? return asset end end
Version data entries
250 entries across 250 versions & 1 rubygems