25 lines
627 B
Ruby
25 lines
627 B
Ruby
class VenueManagementMemorabilia
|
|
include Mongoid::Document
|
|
include Mongoid::Timestamps
|
|
require 'mongoid/enum'
|
|
include Mongoid::Enum
|
|
|
|
field :event_date, type: Date, default: Time.now
|
|
field :details, localize: true
|
|
def case_no
|
|
inviting = self.venue_management_inviting
|
|
if !inviting.nil?
|
|
inviting.case_no
|
|
else
|
|
I18n.t("empty")
|
|
end
|
|
end
|
|
belongs_to :venue_management_inviting
|
|
belongs_to :venue_management_main
|
|
include VenueLinkFile
|
|
def display_details
|
|
html = self.details.to_s.split("\r\n").select{|s| !s.blank?}.first
|
|
return Nokogiri::HTML(html).css("body").text
|
|
end
|
|
end
|