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

Don't assign interpolated string to local variable date - instead pass it directly to Time.parse.

parent 60177ce7
......@@ -15,12 +15,10 @@ module Refinery
def archive
if params[:month].present?
date = "#{params[:month]}/#{params[:year]}"
@archive_date = Time.parse(date)
@archive_date = Time.parse("#{params[:month]}/#{params[:year]}")
@items = Refinery::News::Item.live.by_archive(@archive_date).page(params[:page])
else
date = "01/#{params[:year]}"
@archive_date = Time.parse(date)
@archive_date = Time.parse("01/#{params[:year]}")
@items = Refinery::News::Item.live.by_year(@archive_date).page(params[:page])
end
end
......
Supports Markdown
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