added moderation tests for post test

This commit is contained in:
albert
2010-02-10 16:33:00 -05:00
parent e6888ea1dd
commit 2f3a6e4a8b
3 changed files with 44 additions and 3 deletions

View File

@@ -1,7 +1,6 @@
class Post < ActiveRecord::Base
attr_accessor :updater_id, :updater_ip_addr, :old_tag_string
belongs_to :updater, :class_name => "User"
belongs_to :uploader, :class_name => "User"
has_one :unapproval
after_destroy :delete_files
after_save :create_version
@@ -462,6 +461,14 @@ class Post < ActiveRecord::Base
def uploader_id
uploader_string[5, 100].to_i
end
def uploader
User.find(uploader_id)
end
def uploader=(user)
self.uploader_id = user.id
end
end
include FileMethods