class Question < ActiveRecord::Base
  include Votable

  belongs_to :user
  has_many :answers
  has_many :comments, as: :commentable
  has_many :votes, as: :votable

  validates_presence_of :title, :content, :user_id
end

class Question < ActiveRecord::Base
  include Votable

  belongs_to :user
  has_many :answers
  has_many :comments, as: :commentable
  has_many :votes, as: :votable

  validates_presence_of :title, :content, :user_id

  def best_answer
    Answer.find_by(id: self.best_answer_id)
  end

end

Add best_answer getter method to Question model
Add best_answer getter method to Question model
