seminar2/custom_announcement/app/models/custom_bulletin_carousel_im...

16 lines
323 B
Ruby

# encoding: utf-8
class CustomBulletinCarouselImage
include Mongoid::Document
include Mongoid::Timestamps
mount_uploader :file, AssetUploader
field :description, localize: true
belongs_to :custom_bulletin
def description_text
Nokogiri::HTML(self.description.to_s).css("body").text() rescue ""
end
end