rosa-build/app/models/activity_feed.rb

22 lines
561 B
Ruby
Raw Normal View History

class ActivityFeed < ActiveRecord::Base
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
serialize :data
attr_accessible :user, :kind, :data
default_scope { order created_at: :desc }
scope :outdated, -> { offset(100) }
2012-03-15 17:52:54 +00:00
self.per_page = 10
2012-03-15 17:52:54 +00:00
def partial
'home/partials/' + self.kind
end
end