17 lines
316 B
Ruby
17 lines
316 B
Ruby
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
|