2013-03-24 11:26:49 -04:00
|
|
|
class ProjectSnippet < Snippet
|
|
|
|
belongs_to :project
|
|
|
|
belongs_to :author, class_name: "User"
|
|
|
|
|
|
|
|
validates :project, presence: true
|
|
|
|
|
|
|
|
# Scopes
|
|
|
|
scope :fresh, -> { order("created_at DESC") }
|
2016-04-29 19:02:28 -04:00
|
|
|
|
2016-05-26 07:38:28 -04:00
|
|
|
participant :author
|
|
|
|
participant :notes_with_associations
|
2017-02-01 13:15:59 -05:00
|
|
|
|
|
|
|
def check_for_spam?
|
|
|
|
super && project.public?
|
|
|
|
end
|
2013-03-24 11:26:49 -04:00
|
|
|
end
|