app/models/ckeditor/asset.rb in georgia-0.7.1 vs app/models/ckeditor/asset.rb in georgia-0.7.2
- old
+ new
@@ -3,10 +3,11 @@
# to allow media_path in to_jq_upload
include Georgia::Engine.routes.url_helpers
include Ckeditor::Orm::ActiveRecord::AssetBase
include Georgia::Concerns::Taggable
+ include Georgia::Indexer
delegate :url, :current_path, :content_type, to: :data
mount_uploader :data, CkeditorAttachmentFileUploader, mount_on: :data_file_name
@@ -27,26 +28,9 @@
}
end
def extension
@extension ||= data_content_type.gsub(/.*\/(.*)/, '\1')
- end
-
- searchable do
- text :filename, stored: true
- text :tags do
- tag_list.join(', ')
- end
- string :tags, stored: true, multiple: true do
- tag_list
- end
- string :extension, stored: true do
- extension.try(:downcase)
- end
- time :updated_at
- integer :size, stored: true do
- size / 1024 # gives size in KB
- end
end
SIZE_RANGE = {
'< 25 KB' => 0..25,
'25 KB to 100 KB' => 25..100,
\ No newline at end of file