From dc214d78ff3f557bea0c2f79f176fa8cd6634768 Mon Sep 17 00:00:00 2001 From: Roel Bondoc Date: Sat, 22 Jun 2024 12:39:22 -0400 Subject: [PATCH] fix: assign config to a variable instead of using a method (#143) --- lib/tasks/clickhouse.rake | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/tasks/clickhouse.rake b/lib/tasks/clickhouse.rake index 4854021d..1676b22d 100644 --- a/lib/tasks/clickhouse.rake +++ b/lib/tasks/clickhouse.rake @@ -37,6 +37,8 @@ namespace :clickhouse do end namespace :structure do + config = ActiveRecord::Base.configurations.configs_for(env_name: Rails.env, name: 'clickhouse') + desc 'Load database structure' task load: ['db:check_protected_environments'] do ClickhouseActiverecord::Tasks.new(config).structure_load(Rails.root.join('db/clickhouse_structure.sql')) @@ -85,8 +87,4 @@ namespace :clickhouse do Rake::Task['clickhouse:schema:dump'].execute(simple: true) end end - - def config - ActiveRecord::Base.configurations.configs_for(env_name: Rails.env, name: 'clickhouse') - end end