Commit bb22f2a0 authored by Uģis Ozols's avatar Uģis Ozols
Browse files

Use range to produce "BETWEEN" query.

parent 51b39a59
...@@ -35,11 +35,11 @@ module Refinery ...@@ -35,11 +35,11 @@ module Refinery
class << self class << self
def by_archive(archive_date) def by_archive(archive_date)
where(['publish_date between ? and ?', archive_date.beginning_of_month, archive_date.end_of_month]) where(:publish_date => archive_date.beginning_of_month..archive_date.end_of_month)
end end
def by_year(archive_year) def by_year(archive_year)
where(['publish_date between ? and ?', archive_year.beginning_of_year, archive_year.end_of_year]) where(:publish_date => archive_year.beginning_of_year..archive_year.end_of_year)
end end
def all_previous def all_previous
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment