diff options
| author | hukl <contact@smyck.org> | 2009-03-30 21:29:18 +0200 |
|---|---|---|
| committer | hukl <contact@smyck.org> | 2009-03-30 21:29:18 +0200 |
| commit | 85b60ee48a4c9973d4bc52aacddaa62491ab16ed (patch) | |
| tree | b3a16983d4c5a2e757885936df8f9ecda3e88b26 | |
| parent | 2ca3a93bca6ebc8e4639c1dc028eb7804bc1f727 (diff) | |
added named scope for heads
| -rw-r--r-- | app/models/page.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/page.rb b/app/models/page.rb index dfabecf..b2c0ff8 100644 --- a/app/models/page.rb +++ b/app/models/page.rb | |||
| @@ -13,6 +13,12 @@ class Page < ActiveRecord::Base | |||
| 13 | :conditions => ["nodes.draft_id = pages.id"] | 13 | :conditions => ["nodes.draft_id = pages.id"] |
| 14 | ) | 14 | ) |
| 15 | 15 | ||
| 16 | named_scope( | ||
| 17 | :heads, | ||
| 18 | :include => [:node, :user, :globalize_translations], | ||
| 19 | :conditions => ["nodes.head_id = pages.id"] | ||
| 20 | ) | ||
| 21 | |||
| 16 | # Mixins and Plugins | 22 | # Mixins and Plugins |
| 17 | acts_as_taggable | 23 | acts_as_taggable |
| 18 | acts_as_list :column => :revision, :scope => :node_id | 24 | acts_as_list :column => :revision, :scope => :node_id |
