rosa-build/app/models/activity_feed.rb

22 lines
568 B
Ruby
Raw Normal View History

# -*- encoding : utf-8 -*-
class ActivityFeed < ActiveRecord::Base
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
serialize :data
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
def partial
'activity_feeds/partials/' + self.kind
end
2012-03-15 17:52:54 +00:00
end