2012-01-25 08:31:49 +00:00
|
|
|
class ActivityFeed < ActiveRecord::Base
|
2012-01-26 17:04:58 +00:00
|
|
|
|
2014-03-13 21:36:28 +00:00
|
|
|
CODE = %w(git_delete_branch_notification git_new_push_notification new_comment_commit_notification)
|
|
|
|
TRACKER = %w(issue_assign_notification new_comment_notification new_issue_notification)
|
|
|
|
BUILD = %w(build_list_notification)
|
|
|
|
WIKI = %w(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-14 18:19:08 +00:00
|
|
|
attr_accessible :user_id, :kind, :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
|