diff options
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/refinery/blog/post.rb | 8 |
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) |