Method: Switchman::ActiveRecord::DatabaseConfigurations#configs_for
- Defined in:
-
lib/switchman/active_record/database_configurations.rb,
lib/switchman/active_record/database_configurations.rb
11 12 13 14 15 16 17 18 19 |
# File 'lib/switchman/active_record/database_configurations.rb', line 11 def configs_for(include_replicas: false, name: nil, **) res = super if name && !include_replicas return nil unless name.end_with?("primary") elsif !include_replicas return res.select { |config| config.name.end_with?("primary") } end res end |