updated tests, switched to rails 3.0.0rc2

This commit is contained in:
albert
2010-08-26 14:36:02 -04:00
parent 694b6f0813
commit ad39553aac
48 changed files with 898 additions and 406 deletions

View File

@@ -1,4 +1,6 @@
class RemovedPost < ActiveRecord::Base
has_one :unapproval, :dependent => :destroy, :foreign_key => "post_id"
module RemovalMethods
def unremove!
Post.transaction do
@@ -8,6 +10,17 @@ class RemovedPost < ActiveRecord::Base
end
end
def fast_count(tags)
count = Cache.get("rpfc:#{Cache.sanitize(tags)}")
if count.nil?
count = RemovedPost.find_by_tags("#{tags}").count
if count > Danbooru.config.posts_per_page * 10
Cache.put("rpfc:#{Cache.sanitize(tags)}", count, (count * 4).minutes)
end
end
count
end
include Post::FileMethods
include Post::ImageMethods
include Post::TagMethods