There is the following model:
有以下型号:
class Post < ActiveRecord::Base
default_scope { order(id: :desc) }
validates :title, :content, :keywords, presence: true
has_many :responses, dependent: :destroy
scope :existing, ->{ where(deleted: false) }
scope :enabled, ->{ where(enabled: true) }
end
class