fixed codeclimate errors (partically)

This commit is contained in:
dinsmol 2021-09-09 09:19:09 +03:00
parent 3f41ce4ab4
commit f4e0084895
103 changed files with 339 additions and 367 deletions

View file

@ -8,8 +8,14 @@ module Admin
@q.sorts = 'id desc' if @q.sorts.empty?
@repp_logs = @q.result
@repp_logs = @repp_logs.where("extract(epoch from created_at) >= extract(epoch from ?::timestamp)", Time.parse(params[:q][:created_at_gteq])) if params[:q][:created_at_gteq].present?
@repp_logs = @repp_logs.where("extract(epoch from created_at) <= extract(epoch from ?::timestamp)", Time.parse(params[:q][:created_at_lteq])) if params[:q][:created_at_lteq].present?
if params[:q][:created_at_gteq].present?
@repp_logs = @repp_logs.where("extract(epoch from created_at) >= extract(epoch from ?::timestamp)",
Time.parse(params[:q][:created_at_gteq]))
end
if params[:q][:created_at_lteq].present?
@repp_logs = @repp_logs.where("extract(epoch from created_at) <= extract(epoch from ?::timestamp)",
Time.parse(params[:q][:created_at_lteq]))
end
@repp_logs = @repp_logs.page(params[:page])
@count = @q.result.count
@repp_logs = @repp_logs.per(params[:results_per_page]) if paginate?