aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorPete Higgins <pete@peterhiggins.org>2012-02-10 00:48:32 -0800
committerPete Higgins <pete@peterhiggins.org>2012-02-10 01:07:04 -0800
commitf140ed284f88a2a06846df124aedd08236169b33 (patch)
tree49d6f3607566c7213e85272c0eb37af3412f48e9 /app
parent94ae01ce6fce8e19fb5295da6be302fdbef573c7 (diff)
downloadrefinerycms-blog-f140ed284f88a2a06846df124aedd08236169b33.tar.gz
refinerycms-blog-f140ed284f88a2a06846df124aedd08236169b33.tar.bz2
refinerycms-blog-f140ed284f88a2a06846df124aedd08236169b33.zip
Refactor .by_archive and .by_year.
Diffstat (limited to 'app')
-rw-r--r--app/models/refinery/blog/post.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/models/refinery/blog/post.rb b/app/models/refinery/blog/post.rb
index b6d161c..dbea93f 100644
--- a/app/models/refinery/blog/post.rb
+++ b/app/models/refinery/blog/post.rb
@@ -63,12 +63,12 @@ module Refinery
end
class << self
- def by_archive(archive_date)
- where(['published_at between ? and ?', archive_date.beginning_of_month, archive_date.end_of_month])
+ def by_archive(date)
+ where(:published_at => date.beginning_of_month..date.end_of_month)
end
- def by_year(archive_year)
- where(['published_at between ? and ?', archive_year.beginning_of_year, archive_year.end_of_year])
+ def by_year(date)
+ where(:published_at => date.beginning_of_year..date.end_of_year)
end
def published_dates_older_than(date)