mirror of
https://github.com/internetee/registry.git
synced 2025-07-25 03:58:27 +02:00
fixed codeclimate errors
This commit is contained in:
parent
f4e0084895
commit
e7e3278267
44 changed files with 118 additions and 150 deletions
|
@ -25,13 +25,12 @@ module Admin
|
|||
@account_activities = @q.result.page(params[:page]).per(params[:results_per_page])
|
||||
@count = @q.result.count
|
||||
|
||||
if params[:page] && params[:page].to_i > 1
|
||||
@sum = @q.result.limit(@account_activities.offset_value).sum(:sum) +
|
||||
@b.result.where("account_activities.id NOT IN (#{@q.result.select(:id).to_sql})")
|
||||
.sum(:sum)
|
||||
else
|
||||
@sum = @b.result.where("account_activities.id NOT IN (#{@q.result.select(:id).to_sql})").sum(:sum)
|
||||
end
|
||||
@sum = if params[:page] && params[:page].to_i > 1
|
||||
@q.result.limit(@account_activities.offset_value).sum(:sum) +
|
||||
@b.result.where("account_activities.id NOT IN (#{@q.result.select(:id).to_sql})").sum(:sum)
|
||||
else
|
||||
@b.result.where("account_activities.id NOT IN (#{@q.result.select(:id).to_sql})").sum(:sum)
|
||||
end
|
||||
|
||||
respond_to do |format|
|
||||
format.html
|
||||
|
|
|
@ -3,6 +3,7 @@ module Admin
|
|||
load_and_authorize_resource class: ApiLog::EppLog
|
||||
before_action :set_default_dates, only: [:index]
|
||||
|
||||
# rubocop:disable Metrics/MethodLength
|
||||
def index
|
||||
@q = ApiLog::EppLog.ransack(params[:q])
|
||||
@q.sorts = 'id desc' if @q.sorts.empty?
|
||||
|
@ -20,6 +21,7 @@ module Admin
|
|||
|
||||
render_by_format('admin/epp_logs/index', 'epp_logs')
|
||||
end
|
||||
# rubocop:enable Metrics/MethodLength
|
||||
|
||||
def show
|
||||
@epp_log = ApiLog::EppLog.find(params[:id])
|
||||
|
|
|
@ -3,6 +3,7 @@ module Admin
|
|||
load_and_authorize_resource class: ApiLog::ReppLog
|
||||
before_action :set_default_dates, only: [:index]
|
||||
|
||||
# rubocop:disable Metrics/MethodLength
|
||||
def index
|
||||
@q = ApiLog::ReppLog.search(params[:q])
|
||||
@q.sorts = 'id desc' if @q.sorts.empty?
|
||||
|
@ -22,6 +23,7 @@ module Admin
|
|||
|
||||
render_by_format('admin/repp_logs/index', 'repp_logs')
|
||||
end
|
||||
# rubocop:enable Metrics/MethodLength
|
||||
|
||||
def show
|
||||
@repp_log = ApiLog::ReppLog.find(params[:id])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue