call4paperz/call4paperz

View on GitHub
app/models/comment.rb

Summary

Maintainability
A
0 mins
Test Coverage
class Comment < ApplicationRecord
  belongs_to :proposal, :counter_cache => true
  belongs_to :user

  validates_associated :user, :proposal
  validates_presence_of :body

  def self.most_recent
    order("created_at DESC").limit(4)
  end
end