2012-01-25 08:31:49 +00:00
|
|
|
class ActivityFeed < ActiveRecord::Base
|
2012-01-26 17:04:58 +00:00
|
|
|
|
2014-03-11 07:39:25 +00:00
|
|
|
CODE = ['git_delete_branch_notification', 'git_new_push_notification', 'new_comment_commit_notification']
|
2012-03-15 17:52:54 +00:00
|
|
|
TRACKER = ['issue_assign_notification', 'new_comment_notification', 'new_issue_notification']
|
2014-03-11 07:39:25 +00:00
|
|
|
BUILD = ['build_list_notification']
|
|
|
|
WIKI = ['wiki_new_commit_notification']
|
2012-03-15 17:52:54 +00:00
|
|
|
|
|
|
|
belongs_to :user
|
2012-01-26 17:04:58 +00:00
|
|
|
serialize :data
|
|
|
|
|
2014-03-11 07:39:25 +00:00
|
|
|
default_scope { order created_at: :desc }
|
|
|
|
scope :outdated, -> { offset(100) }
|
2012-03-15 17:52:54 +00:00
|
|
|
|
|
|
|
self.per_page = 10
|
|
|
|
|
2012-01-26 17:04:58 +00:00
|
|
|
def partial
|
2013-05-15 18:28:39 +01:00
|
|
|
'home/partials/' + self.kind
|
2012-01-26 17:04:58 +00:00
|
|
|
end
|
2012-01-25 08:31:49 +00:00
|
|
|
end
|