eager load page tags

git-svn-id: http://svn.barleysodas.com/barleysodas/trunk@38 0f7b21a7-9e3a-4941-bbeb-ce5c7c368fa7
master
andrew 2007-11-17 08:42:41 +00:00
parent c713c6f321
commit f4eb783a8a
1 changed files with 2 additions and 1 deletions

View File

@ -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