Permalink
Browse files

Fixing find_all to exclude future posts

This method is used for the Sitemap and would currently allow for future posts to show up on the sitemap
  • Loading branch information...
1 parent 818b0f2 commit 861b3c8908b597255f186ca5bd88d235aa980057 Andrew Hooker committed Sep 27, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/nesta/models.rb
View
@@ -186,7 +186,7 @@ def self.find_by_path(path)
end
def self.find_all
- super.select { |p| ! p.hidden? }
+ super.select { |p| ! p.hidden? }.select{ |p| p.date.nil? || p.date < DateTime.now }
end
def self.find_articles

0 comments on commit 861b3c8

Please sign in to comment.