2013-05-27 09:29:59 +00:00
|
|
|
class AskQuestion
|
2013-08-27 04:36:29 +00:00
|
|
|
include Mongoid::Document
|
|
|
|
include ActiveModel::Validations
|
|
|
|
include ActiveModel::Conversion
|
|
|
|
extend ActiveModel::Naming
|
|
|
|
|
|
|
|
include OrbitCategory::Categorizable
|
|
|
|
include OrbitModel::Approval
|
2013-05-27 09:29:59 +00:00
|
|
|
include Mongoid::Document
|
|
|
|
include Mongoid::Timestamps
|
|
|
|
|
|
|
|
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
|
|
|
|
|
2013-05-27 09:39:39 +00:00
|
|
|
validates_presence_of :name, :identity, :email, :title, :content
|
2013-05-27 09:29:59 +00:00
|
|
|
|
|
|
|
has_one :ask_reply, dependent: :destroy
|
2013-08-19 02:12:28 +00:00
|
|
|
|
2013-05-27 09:29:59 +00:00
|
|
|
end
|