Refactor .by_archive and .by_year.
This commit is contained in:
parent
94ae01ce6f
commit
f140ed284f
1 changed files with 4 additions and 4 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue