c63194ce6f
Apply the same spam checks to public snippets (either personal snippets that are public, or public snippets on public projects) as to issues on public projects.
16 lines
316 B
Ruby
16 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
|