diff --git a/Gemfile b/Gemfile index 0a9208904..fd14fd1fb 100644 --- a/Gemfile +++ b/Gemfile @@ -19,7 +19,7 @@ gem 'figaro', '~> 1.2' gem 'paper_trail', '~> 12.1' gem 'pg', '1.2.3' # 1.8 is for Rails < 5.0 -gem 'ransack', '~> 2.3' +gem 'ransack', '~> 2.4.2' gem 'truemail', '~> 2.4' # validates email by regexp, mail server existence and address existence gem 'validates_email_format_of', '1.6.3' # validates email against RFC 2822 and RFC 3696 diff --git a/Gemfile.lock b/Gemfile.lock index c6d187b15..b393a0894 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -560,7 +560,7 @@ DEPENDENCIES que que-web rails (~> 6.1.4) - ransack (~> 2.3) + ransack (~> 2.4.2) rest-client rexml sass-rails @@ -579,4 +579,4 @@ DEPENDENCIES wkhtmltopdf-binary (~> 0.12.5.1) BUNDLED WITH - 2.2.26 + 2.2.27 diff --git a/app/controllers/admin/invoices_controller.rb b/app/controllers/admin/invoices_controller.rb index 96a106d18..68db492d8 100644 --- a/app/controllers/admin/invoices_controller.rb +++ b/app/controllers/admin/invoices_controller.rb @@ -93,12 +93,12 @@ module Admin def filter_by_receipt_date(invoices) date_from_param = params[:q][:receipt_date_gteq] if params[:q][:receipt_date_gteq].present? - date_from = date_from_param ? Time.zone.parse(date_from_param) : -Float::INFINITY + date_from = date_from_param ? Time.zone.parse(date_from_param) : nil date_until_param = params[:q][:receipt_date_lteq] if params[:q][:receipt_date_lteq].present? - date_until = date_until_param ? Time.zone.parse(date_from_param) : Float::INFINITY + date_until = date_until_param ? Time.zone.parse(date_until_param) : nil - invoices.where(account_activity: { created_at: date_from..date_until }) + invoices.where(account_activities: { created_at: date_from..date_until }) end end end