class Question < ActiveRecord::Base
  belongs_to :user
  has_many :answers
  has_many :votes, as: :votable
  has_many :comments, as: :commentable

  def to_param
    "#{id}-#{title.parameterize}"
  end
end

class Question < ActiveRecord::Base
  belongs_to :user
  has_many :answers
  has_many :votes, as: :votable
  has_many :comments, as: :commentable

  validates :title, :content, :user_id, presence: true

  def to_param
    "#{id}-#{title.parameterize}"
  end
end

Add validations to Question model
Add validations to Question model
