mirror of
https://github.com/internetee/registry.git
synced 2025-06-03 19:27:29 +02:00
fixed test error
This commit is contained in:
parent
4770411cda
commit
e9750aee31
1 changed files with 10 additions and 2 deletions
|
@ -92,8 +92,16 @@ module Admin
|
|||
end
|
||||
|
||||
def filter_by_receipt_date(invoices)
|
||||
date_from = Time.zone.parse(params[:q][:receipt_date_gteq]) || -Float::INFINITY
|
||||
date_until = Time.zone.parse(params[:q][:receipt_date_lteq]) || Float::INFINITY
|
||||
date_from = if params[:q][:receipt_date_gteq].present?
|
||||
Time.zone.parse(params[:q][:receipt_date_gteq])
|
||||
else
|
||||
-Float::INFINITY
|
||||
end
|
||||
date_until = if params[:q][:receipt_date_lteq].present?
|
||||
Time.zone.parse(params[:q][:receipt_date_lteq])
|
||||
else
|
||||
Float::INFINITY
|
||||
end
|
||||
invoices.where(account_activity: { created_at: date_from..date_until })
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue