From f4eb783a8a88ccbae97e0870d367a00fad52a461 Mon Sep 17 00:00:00 2001 From: andrew Date: Sat, 17 Nov 2007 08:42:41 +0000 Subject: [PATCH] eager load page tags git-svn-id: http://svn.barleysodas.com/barleysodas/trunk@38 0f7b21a7-9e3a-4941-bbeb-ce5c7c368fa7 --- lib/has_one_page.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/has_one_page.rb b/lib/has_one_page.rb index 3d3b4e4..af5163e 100644 --- a/lib/has_one_page.rb +++ b/lib/has_one_page.rb @@ -23,7 +23,8 @@ module ActiveRecord # :nodoc: class_eval do has_one :page, :foreign_key => 'owner_id', :dependent => :destroy, - :conditions => "pages.owner_type = '#{options[:owner_class]}'" + :conditions => "pages.owner_type = '#{options[:owner_class]}'", + :include => 'tags' before_save :ensure_tuxwiki_page_valid after_save :save_tuxwiki_page end