added news updates ui

This commit is contained in:
albert
2011-11-01 17:51:15 -04:00
parent b06857f8bd
commit 461fe9a6dc
21 changed files with 287 additions and 20 deletions

15
app/models/news_update.rb Normal file
View File

@@ -0,0 +1,15 @@
class NewsUpdate < ActiveRecord::Base
belongs_to :creator, :class_name => "User"
belongs_to :udpater, :class_name => "User"
scope :recent, order("created_at desc").limit(5)
before_validation :initialize_creator, :on => :create
before_validation :initialize_updater
def initialize_creator
self.creator_id = CurrentUser.id
end
def initialize_updater
self.updater_id = CurrentUser.id
end
end