Sha256: 6d98b9dcef0434a226cfecdabbb6e494c700bf0a7069315e688fa7fafaec62aa
Contents?: true
Size: 620 Bytes
Versions: 27
Compression:
Stored size: 620 Bytes
Contents
class Attachment < ActiveRecord::Base has_paper_trail has_attached_file :attachment acts_as_indexed :fields => [:title, :attachment_file_name, :attachment_content_type, :attachable_type] belongs_to :attachable, :polymorphic => true include Soapbox::Attachment if File.exists? "app/models/soapbox/attachment.rb" def self.content_types t = self.find_by_sql(["SELECT DISTINCT(attachment_content_type) FROM attachments"]) types = [] t.each do |type| short = type.attachment_content_type.split("/").first rescue next types.push(short) if types.index(short).nil? end types end end
Version data entries
27 entries across 27 versions & 1 rubygems