app/models/answer.rb
# Determine the page the answer appears on.
Determine the page the answer appears on.
Determine the page the answer appears on .
def page
    position = self.class.where('created_at >= ? AND question_id = ?',
                                created_at, question_id).count
    (position.to_f / ANSWERS_PER_PAGE).ceil
  end
def page position = self . class . where ( 'created_at >= ? AND question_id = ?' , created_at , question_id ) . count ( position . to_f / ANSWERS_PER_PAGE ) . ceil end
Determine the page the answer appears on.
Determine the page the answer appears on .