Sha256: bdea9869709b8e6bcfdcb99fa0140d48232b0b2620c972db3e92243e4634f3d4

Contents?: true

Size: 849 Bytes

Versions: 5

Compression:

Stored size: 849 Bytes

Contents

##
## @report.body.split("\n\n").map { |ttt| "<p>#{ttt}</p>" }.join
##
class Wco::Report
  include Mongoid::Document
  include Mongoid::Timestamps
  include Mongoid::Paranoia
  include Wco::Utils
  store_in collection: 'wco_reports'

  PAGE_PARAM_NAME = 'reports_page'

  field :title
  validates :title, presence: true # , uniqueness: true
  index({ title: 1 }, { unique: true })
  def name ; title ; end

  field :subtitle
  field :legacy_id, type: String

  field :slug
  validates :slug, presence: true, uniqueness: true
  index({ :slug => 1 }, { :unique => true })
  before_validation :set_slug, on: :create

  field :body

  field :x, :type => Float
  field :y, :type => Float
  field :z, :type => Float

  belongs_to :author, class_name: 'Wco::Profile'

  # has_one :image_thumb
  # has_one :image_hero

  has_and_belongs_to_many :tags

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
wco_models-3.1.0.201 app/models/wco/report.rb
wco_models-3.1.0.199 app/models/wco/report.rb
wco_models-3.1.0.198 app/models/wco/report.rb
wco_models-3.1.0.197 app/models/wco/report.rb
wco_models-3.1.0.196 app/models/wco/report.rb