Sha256: b7879130d07abb6ac31770fb101f9d790a139fc8899431f5bd44f574540899c9

Contents?: true

Size: 933 Bytes

Versions: 20

Compression:

Stored size: 933 Bytes

Contents

require 'redactor-rails/orm/base'

module RedactorRails
  module Orm
    module Mongoid
      module AssetBase
        def self.included(base)
          base.send(:include, Base::AssetBase::InstanceMethods)
          base.send(:extend, ClassMethods)
        end

        module ClassMethods
          def self.extended(base)
            base.class_eval do
              store_in :collection => 'redactor_assets'

              belongs_to :assetable, :polymorphic => true

              field :data_file_name, :type => String
              field :data_content_type, :type => String
              field :data_file_size, :type => Integer

              field :type, :type => String

              field :width, :type => Integer
              field :height, :type => Integer

              index( :assetable => 1, :type => 1 )
              index( :assetable => 1 )

            end
          end
        end
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 5 rubygems

Version Path
redactor-rails-fixes-0.5.0.1 lib/redactor-rails/orm/mongoid.rb
rdrails5-0.5.1 lib/redactor-rails/orm/mongoid.rb
redactor-rails4-0.5.0 lib/redactor-rails/orm/mongoid.rb
redactor-rails-0.5.0 lib/redactor-rails/orm/mongoid.rb
redactor-rails-0.4.5 lib/redactor-rails/orm/mongoid.rb
redactor-rails-0.4.4 lib/redactor-rails/orm/mongoid.rb
th_simple_content_management-0.2.7 lib/redactor-rails/orm/mongoid.rb
th_simple_content_management-0.2.6 lib/redactor-rails/orm/mongoid.rb
th_simple_content_management-0.2.5 lib/redactor-rails/orm/mongoid.rb
th_simple_content_management-0.2.4 lib/redactor-rails/orm/mongoid.rb
th_simple_content_management-0.2.3 lib/redactor-rails/orm/mongoid.rb
redactor-rails-0.4.3 lib/redactor-rails/orm/mongoid.rb
redactor-rails-0.4.2 lib/redactor-rails/orm/mongoid.rb
redactor-rails-0.4.1 lib/redactor-rails/orm/mongoid.rb
redactor-rails-0.3.7 lib/redactor-rails/orm/mongoid.rb
redactor-rails-0.3.6 lib/redactor-rails/orm/mongoid.rb
redactor-rails-0.4 lib/redactor-rails/orm/mongoid.rb
th_simple_content_management-0.2.2 lib/redactor-rails/orm/mongoid.rb
redactor-rails-0.3.5 lib/redactor-rails/orm/mongoid.rb
redactor-rails-0.3.3 lib/redactor-rails/orm/mongoid.rb