public
Fork of halorgium/mephisto
Description: A refactored Mephisto that has multiple spam detection engines.
Homepage: http://mephistoblog.com/
Clone URL: git://github.com/francois/mephisto.git
scope cached pages to sites

git-svn-id: http://svn.techno-weenie.net/projects/mephisto/trunk@2116 
567b1171-46fb-0310-a4c9-b4bef9110e78
technoweenie (author)
Fri Sep 08 18:30:09 -0700 2006
commit  a9a307684ae8d4d7c32e9ee6c5b8b32703c703b8
tree    f6ab6259744ab4879b1fdddce8bedae08e45ab21
parent  c3df3b519d27c06b8e0968ba65b3b5f70f262908
...
11
12
13
14
 
15
16
17
...
11
12
13
 
14
15
16
17
0
@@ -11,7 +11,7 @@ class CachedPage < ActiveRecord::Base
0
   @@current_scope_conditions = { :find => { :conditions => "cleared_at IS NULL OR cleared_at < updated_at" } }
0
   cattr_reader :current_scope_conditions
0
   belongs_to :site
0
- validates_uniqueness_of :url
0
+ validates_uniqueness_of :url, :scope => :site_id
0
 
0
   class << self
0
     def with_current_scope(&block)
...
20
21
22
 
23
24
...
20
21
22
23
24
25
0
@@ -20,5 +20,6 @@ class MoveToScopedCachedPages < ActiveRecord::Migration
0
     pages.each do |page|
0
       ActionController::Base.expire_page "/#{prefix}#{page.url}"
0
     end
0
+ CachedPage.destroy_all ['id in (?)', pages.collect(&:id)]
0
   end
0
 end

Comments

    No one has commented yet.