mirror of
https://github.com/internetee/registry.git
synced 2025-06-11 15:14:47 +02:00
fixed codeclimate errors (partically)
This commit is contained in:
parent
3f41ce4ab4
commit
f4e0084895
103 changed files with 339 additions and 367 deletions
|
@ -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?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue