Sha256: b1aa9d32e6f075dfaaa8c7253fbc579e37f79e370e95b60fd90ad80e456731e0
Contents?: true
Size: 515 Bytes
Versions: 27
Compression:
Stored size: 515 Bytes
Contents
module Cms module Fortress module FileMethods def self.included(base) base.class_eval do image_mimetypes = %w(gif jpeg pjpeg png tiff).collect{|subtype| "image/#{subtype}"} video_mimetypes = %w(mp4 ogg webm).collect{|subtype| "video/#{subtype}"} scope :videos, -> { where(:file_content_type => video_mimetypes) } scope :others, -> { where('file_content_type NOT IN (?)', image_mimetypes + video_mimetypes) } end end end end end
Version data entries
27 entries across 27 versions & 1 rubygems