updated tests, switched to rails 3.0.0rc2
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user