event_news/app/models/event_carousel_image.rb

16 lines
324 B
Ruby
Raw Normal View History

2022-01-21 02:09:31 +00:00
# encoding: utf-8
class EventCarouselImage
include Mongoid::Document
include Mongoid::Timestamps
mount_uploader :file, AssetUploader
field :description, localize: true
belongs_to :event_news
def description_text
Nokogiri::HTML(self.description.to_s).css("body").text() rescue ""
end
end