Skip to content

Commit

Permalink
Fix Rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
tungleduyxyz committed Apr 24, 2024
1 parent 1678e3a commit 739a496
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
5 changes: 2 additions & 3 deletions app/controllers/kaui/accounts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,8 @@ def show
end

fetch_payment_methods_with_details = fetch_payment_methods.then do |pms|
ops = []
pms.each do |pm|
ops << promise do
ops = pms.map do |pm|
promise do
Kaui::PaymentMethod.find_by_id(pm.payment_method_id, true, cached_options_for_klient)
rescue StandardError => e
# Maybe the plugin is not registered or the plugin threw an exception
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/kaui/admin_tenants_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -456,8 +456,8 @@ def catalog_by_effective_date
# convert result to a full hash since dynamic attributes of a class are ignored when converting to json
result.each do |data|
plans = []
data[:plans].each do |plan|
plans << plan.instance_variables.each_with_object({}) { |var, hash_plan| hash_plan[var.to_s.delete('@')] = plan.instance_variable_get(var) }
plans = data[:plans].map do |plan|
plan.instance_variables.each_with_object({}) { |var, hash_plan| hash_plan[var.to_s.delete('@')] = plan.instance_variable_get(var) }
end

catalog << { version_date: data[:version_date],
Expand Down
1 change: 1 addition & 0 deletions lib/tasks/kaui_tasks.rake
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

# desc "Explaining what the task does"
# task :kaui do
# # Task goes here
Expand Down
6 changes: 2 additions & 4 deletions test/unit/kaui/admin_tenant_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -108,17 +108,15 @@ class AdminTenantTest < ActiveSupport::TestCase
private

def plugins_repo
plugins_info = []
hash_plugin_info = JSON.parse(PLUGIN_REPO)
hash_plugin_info.each do |plugin|
plugins_info << {
hash_plugin_info.map do |plugin|
{
plugin_key: plugin['plugin_key'],
plugin_name: plugin['plugin_name'],
plugin_type: nil,
installed: true
}
end
plugins_info
end

def assert_split(splitted)
Expand Down

0 comments on commit 739a496

Please sign in to comment.