22 lines
426 B
Ruby
22 lines
426 B
Ruby
# encoding: utf-8
|
|
class GreetingCardImage
|
|
|
|
include Mongoid::Document
|
|
include Mongoid::Timestamps
|
|
|
|
mount_uploader :file, ImageUploader
|
|
|
|
field :description, localize: true
|
|
|
|
belongs_to :greeting_card_setting
|
|
|
|
belongs_to :greeting_card_category_setting
|
|
|
|
def description_text
|
|
if self.description.blank?
|
|
""
|
|
else
|
|
Nokogiri::HTML::fragment(self.description.to_s).text
|
|
end
|
|
end
|
|
end |