Skip to content

Commit

Permalink
fix: assign config to a variable instead of using a method (PNixx#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
roelbondoc authored and syabruk committed Aug 19, 2024
1 parent 7deff6c commit dc214d7
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/tasks/clickhouse.rake
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
Expand Down Expand Up @@ -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

0 comments on commit dc214d7

Please sign in to comment.