summaryrefslogtreecommitdiff
path: root/app/models/page.rb
diff options
context:
space:
mode:
authorhukl <contact@smyck.org>2009-04-18 15:10:19 +0200
committerhukl <contact@smyck.org>2009-04-18 15:10:19 +0200
commit0c305d3f702c637266cbd1543ed9b6063bbb4e45 (patch)
treea1471d3e52be89b51f7a9b6ffaafa325fe1f43fc /app/models/page.rb
parent3f28b7c924a628821025b6ebdf6672bf215ee7e0 (diff)
changed :include to :join which is much faster. adding named scopes with includes if they are needed
Diffstat (limited to 'app/models/page.rb')
-rw-r--r--app/models/page.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/page.rb b/app/models/page.rb
index b2c0ff8..d677073 100644
--- a/app/models/page.rb
+++ b/app/models/page.rb
@@ -9,13 +9,13 @@ class Page < ActiveRecord::Base
9 9
10 named_scope( 10 named_scope(
11 :drafts, 11 :drafts,
12 :include => [:node, :user, :globalize_translations], 12 :joins => :node,
13 :conditions => ["nodes.draft_id = pages.id"] 13 :conditions => ["nodes.draft_id = pages.id"]
14 ) 14 )
15 15
16 named_scope( 16 named_scope(
17 :heads, 17 :heads,
18 :include => [:node, :user, :globalize_translations], 18 :joins => :node,
19 :conditions => ["nodes.head_id = pages.id"] 19 :conditions => ["nodes.head_id = pages.id"]
20 ) 20 )
21 21