Skip to content
This repository has been archived by the owner on Mar 3, 2024. It is now read-only.

Commit

Permalink
Fix caching issues, attempt to fix bundler issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Sutto committed Aug 24, 2010
1 parent 44a7015 commit 1c565bf
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions Capfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ require 'rubygems'
require 'bundler/setup'
require 'youthtree-capistrano'

set :bundle_dir, "$GEM_HOME"
set :application, "tedxperth"
set :repository_name, "TEDxPerth"
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ GEM
validates_url_format_of (0.1.0)
activerecord (>= 2.3.4)
validation_reflection (1.0.0.rc.1)
youthtree-capistrano (0.0.1)
youthtree-capistrano (0.0.3)
bundler (~> 1.0)
capistrano
rvm (~> 1.0)
Expand Down
5 changes: 4 additions & 1 deletion app/models/page.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ class Page < ActiveRecord::Base
is_sortable :menu_position, :if_field => :show_in_menu

scope :renderable, select('rendered_content, `key`, title, keywords, description')
scope :for_menu, published.sortable_items.sorted_asc.select('id, `key`, cached_slug, menu_subtitle, menu_title, title')

def self.for_menu
published.sortable_items.sorted_asc.select('id, `key`, cached_slug, menu_subtitle, menu_title, title')
end

def self.[](identifier)
where(:key => identifier.to_s).first
Expand Down
5 changes: 4 additions & 1 deletion app/models/post.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@ class Post < ActiveRecord::Base
is_sluggable :title

scope :for_listing, select('title, cached_slug, published_at, id')
scope :for_sidebar, ordered.published.for_listing

mount_uploader :image, BlogImageUploader

def self.find_using_preview_key(key)
where(:preview_key => key).first
end

def self.for_sidebar
ordered.published.for_listing
end

before_save :generate_preview_key
before_save :generate_summarized_content
Expand Down

0 comments on commit 1c565bf

Please sign in to comment.