Sha256: 9e7ba13fdb8bb55dcccac4402a3b166009fa3c7d0eb3730b92d86b0ac8fba11f
Contents?: true
Size: 1.14 KB
Versions: 22
Compression:
Stored size: 1.14 KB
Contents
require 'orm_adapter/adapters/mongoid' require 'ckeditor/orm/base' module Ckeditor module Orm module Mongoid module AssetBase def self.included(base) base.send(:include, ::Mongoid::Document) base.send(:include, ::Mongoid::Timestamps) base.send(:include, Base::AssetBase::InstanceMethods) base.send(:include, InstanceMethods) base.send(:extend, ClassMethods) end module InstanceMethods def type _type end def as_json_methods [:id, :type] + super end end module ClassMethods def self.extended(base) base.class_eval do field :data_content_type, :type => String field :data_file_size, :type => Integer field :width, :type => Integer field :height, :type => Integer belongs_to :assetable, :polymorphic => true attr_accessible :data, :assetable_type, :assetable_id, :assetable end end end end end end end
Version data entries
22 entries across 22 versions & 3 rubygems