21 lines
483 B
Ruby
21 lines
483 B
Ruby
class AskQuestion
|
|
include Mongoid::Document
|
|
include Mongoid::Timestamps
|
|
include OrbitCoreLib::ObjectDisable
|
|
|
|
field :name, type: String
|
|
field :identity, type: String
|
|
field :email, type: String
|
|
field :phone, type: String
|
|
field :tax, type: String
|
|
field :title, type: String
|
|
field :content, type: String
|
|
|
|
validates_presence_of :name, :identity, :email, :title, :content
|
|
|
|
belongs_to :ask_category
|
|
has_one :ask_reply, dependent: :destroy
|
|
|
|
paginates_per 10
|
|
end
|