crispgm/holy-images

View on GitHub
app/models/comment.rb

Summary

Maintainability
A
0 mins
Test Coverage
class Comment < ApplicationRecord
  STATUS_OK = 0

  belongs_to :user
  belongs_to :image

  has_many :notifications, as: :event

  validates :content, length: {maximum: 140}, presence: true

  default_scope do
    where(status: STATUS_OK)
    order(created_at: :desc)
  end
end