[Wow, that was ugly.  I've never really tried pasting code into gmail before.  Let's see if this works]

Heh.  Easy.  Since we're single-threaded, we can just do:

  def perform_action_without_filters
    scope_for_content = {:find => {:conditions => "blog_id = #{this_blog.id}"},
                         :create => {:blog_id => this_blog.id}}

    Content.with_scope(scope_for_content) do
      Article.with_scope(scope_for_content) do
        Comment.with_scope(scope_for_content) do
          Trackback.with_scope (scope_for_content) do
            Page.with_scope(scope_for_co ntent) do
              $blog_id = this_blog.id
              super
            end
          end
        end
      end
    e nd

    class Content
      def initialize
        ...
        self.blog_id = $blog_id
      end
    end

Should work.  It's horrifically ugly, but it should end up working.

I'm not really advocating doing it this way, but it's probably the
shortest path to working multi-blog support.  It's also the shortest
path to madness, but we might be able to extract it into something
less evil.


Scott

_______________________________________________
Typo-list mailing list
Typo-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/typo-list

Reply via email to