2012-03-22 17:11:12 +00:00
|
|
|
# -*- encoding : utf-8 -*-
|
2012-01-25 08:31:49 +00:00
|
|
|
class ActivityFeed < ActiveRecord::Base
|
2012-01-26 17:04:58 +00:00
|
|
|
|
2012-03-15 17:52:54 +00:00
|
|
|
CODE = ['git_delete_branch_notification', 'git_new_push_notification', 'new_comment_commit_notification']
|
|
|
|
TRACKER = ['issue_assign_notification', 'new_comment_notification', 'new_issue_notification']
|
2012-03-16 18:58:41 +00:00
|
|
|
BUILD = ['build_list_notification']
|
2012-03-15 17:52:54 +00:00
|
|
|
WIKI = ['wiki_new_commit_notification']
|
|
|
|
|
|
|
|
belongs_to :user
|
2012-01-26 17:04:58 +00:00
|
|
|
serialize :data
|
|
|
|
|
2013-02-28 15:30:51 +00:00
|
|
|
default_scope order("#{table_name}.created_at DESC")
|
2012-11-14 18:10:03 +00:00
|
|
|
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-03-15 17:52:54 +00:00
|
|
|
|
2012-01-25 08:31:49 +00:00
|
|
|
end
|