summaryrefslogtreecommitdiff
path: root/app/models/project_snippet.rb
blob: 9bb456eee24755149b1e6025c2955a5525d3b4d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
class ProjectSnippet < Snippet
  belongs_to :project
  belongs_to :author, class_name: "User"

  validates :project, presence: true

  # Scopes
  scope :fresh, -> { order("created_at DESC") }

  participant :author
  participant :notes_with_associations

  def check_for_spam?
    super && project.public?
  end
end