Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Now runs less queries when rendering the menu using .includes on all …

…of the associations used.
  • Loading branch information...
commit c12c2e56b3917eb847041eeb523561e76442f773 1 parent ea58c03
@parndt parndt authored
View
6 Gemfile.lock
@@ -8,7 +8,7 @@ GIT
PATH
remote: .
specs:
- refinerycms (0.9.8.1)
+ refinerycms (0.9.8.2)
acts_as_indexed (~> 0.6.6)
authlogic (~> 2.1.6)
bundler (~> 1.0.0)
@@ -82,7 +82,7 @@ GEM
culerity (0.2.12)
database_cleaner (0.5.2)
diff-lcs (1.1.2)
- dragonfly (0.7.5)
+ dragonfly (0.7.6)
rack
erubis (2.6.6)
abstract (>= 1.0.0)
@@ -109,7 +109,7 @@ GEM
nokogiri (1.4.3.1)
polyglot (0.3.1)
rack (1.2.1)
- rack-cache (0.5.2)
+ rack-cache (0.5.3)
rack (>= 0.4)
rack-mount (0.6.13)
rack (>= 1.0.0)
View
2  vendor/refinerycms/core/lib/refinery/application_controller.rb
@@ -79,7 +79,7 @@ def login?
# get all the pages to be displayed in the site menu.
def find_pages_for_menu
- @menu_pages = Page.order('lft ASC')
+ @menu_pages = Page.order('lft ASC').includes(:slugs, :slug, :parts)
end
# use a different model for the meta information.
View
3  vendor/refinerycms/pages/app/models/page.rb
@@ -16,7 +16,8 @@ class Page < ActiveRecord::Base
:allow_destroy => true
# Docs for acts_as_indexed http://github.com/dougal/acts_as_indexed
- acts_as_indexed :fields => [:title, :meta_keywords, :meta_description, :custom_title, :browser_title, :all_page_part_content]
+ acts_as_indexed :fields => [:title, :meta_keywords, :meta_description,
+ :custom_title, :browser_title, :all_page_part_content]
before_destroy :deletable?
after_save :reposition_parts!
Please sign in to comment.
Something went wrong with that request. Please try again.