registered-sites/app/models/site_log.rb

15 lines
425 B
Ruby

class SiteLog
include Mongoid::Document
include Mongoid::Timestamps
field :title
field :content
field :archive, type: Boolean, default: false
field :create_user_id, type: BSON::ObjectId
field :update_user_id, type: BSON::ObjectId
belongs_to :registered_site
has_many :site_log_files, autosave: true, dependent: :destroy
accepts_nested_attributes_for :site_log_files, :allow_destroy => true
end