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

Version Path
cms-fortress-1.3.15 lib/cms/fortress/file_methods.rb
cms-fortress-1.3.14 lib/cms/fortress/file_methods.rb
cms-fortress-1.3.13 lib/cms/fortress/file_methods.rb
cms-fortress-1.3.12 lib/cms/fortress/file_methods.rb
cms-fortress-1.3.11 lib/cms/fortress/file_methods.rb
cms-fortress-1.3.10 lib/cms/fortress/file_methods.rb
cms-fortress-1.3.9 lib/cms/fortress/file_methods.rb
cms-fortress-1.3.8 lib/cms/fortress/file_methods.rb
cms-fortress-1.3.7 lib/cms/fortress/file_methods.rb
cms-fortress-1.3.6 lib/cms/fortress/file_methods.rb
cms-fortress-1.3.5 lib/cms/fortress/file_methods.rb
cms-fortress-1.3.4 lib/cms/fortress/file_methods.rb
cms-fortress-1.3.3 lib/cms/fortress/file_methods.rb
cms-fortress-1.3.2 lib/cms/fortress/file_methods.rb
cms-fortress-1.3.1 lib/cms/fortress/file_methods.rb
cms-fortress-1.3.0 lib/cms/fortress/file_methods.rb
cms-fortress-1.3.0.rc3 lib/cms/fortress/file_methods.rb
cms-fortress-1.3.0.rc2 lib/cms/fortress/file_methods.rb
cms-fortress-1.3.0.rc1 lib/cms/fortress/file_methods.rb
cms-fortress-1.2.2 lib/cms/fortress/file_methods.rb