Permalink
Browse files

fixed page 404 error

  • Loading branch information...
1 parent 69de295 commit 7e488151f7dfce5535f7d99464ffa1456b44b591 Josh Adams committed Mar 11, 2009
Showing with 1 addition and 1 deletion.
  1. +1 −1 app/models/page.rb
View
@@ -27,7 +27,7 @@ class Page < ActiveRecord::Base
validates_presence_of :name, :title
- named_scope :visible, :conditions => ["(expires_on > ? OR expires_on IS NULL) AND published = ? AND (publish_at <= ? OR publish_at IS NULL )", Time.now.getgm, true, Time.now.getgm]
+ named_scope :visible, lambda{ { :conditions => ["(expires_on > ? OR expires_on IS NULL) AND published = ? AND (publish_at <= ? OR publish_at IS NULL )", Time.now.getgm, true, Time.now.getgm] } }
named_scope :self_and_siblings, lambda {|page| {:conditions => ["parent_id = ?", page.parent_id], :order => 'page_order'}}
named_scope :expired, lambda {|p| { :conditions => ["expires_on < ?", Time.now.getgm] } }
named_scope :expires_soon, lambda {|p| { :conditions => ["expires_on < ?", Time.now.getgm + 5.days ] } }

0 comments on commit 7e48815

Please sign in to comment.