From 48555c23b615f6487a9014bcd3ec83b20ccf7fdf Mon Sep 17 00:00:00 2001 From: dinsmol Date: Thu, 19 Aug 2021 09:42:15 +0300 Subject: [PATCH] fixed codeclimate errors --- app/controllers/admin/accounts_controller.rb | 2 +- app/models/account_activity.rb | 8 ++++---- app/views/admin/accounts/index.html.erb | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/controllers/admin/accounts_controller.rb b/app/controllers/admin/accounts_controller.rb index 5f7616b3e..2759ebfd3 100644 --- a/app/controllers/admin/accounts_controller.rb +++ b/app/controllers/admin/accounts_controller.rb @@ -5,7 +5,7 @@ module Admin def index @q = Account.includes(:registrar).search(params[:q]) @accounts = @q.result.page(params[:page]) - @accounts = @accounts.per(params[:results_per_page]) if params[:results_per_page].to_i.positive? + @accounts = @accounts.per(params[:results_per_page]) if paginate? render_by_format('admin/accounts/index', 'accounts') end diff --git a/app/models/account_activity.rb b/app/models/account_activity.rb index d59670995..432d444d8 100644 --- a/app/models/account_activity.rb +++ b/app/models/account_activity.rb @@ -5,10 +5,10 @@ class AccountActivity < ApplicationRecord belongs_to :invoice belongs_to :price, class_name: 'Billing::Price' - CREATE = 'create' - RENEW = 'renew' - ADD_CREDIT = 'add_credit' - UPDATE_CREDIT = 'update_credit' + CREATE = 'create'.freeze + RENEW = 'renew'.freeze + ADD_CREDIT = 'add_credit'.freeze + UPDATE_CREDIT = 'update_credit'.freeze after_create :update_balance def update_balance diff --git a/app/views/admin/accounts/index.html.erb b/app/views/admin/accounts/index.html.erb index 60ecdb15b..778d3d0af 100644 --- a/app/views/admin/accounts/index.html.erb +++ b/app/views/admin/accounts/index.html.erb @@ -18,7 +18,7 @@ - <%= render @accounts %> + <%= render partial: 'account', collection: @accounts %>