Module: ActiveRecord::Dbt::DbtPackage::DbtUtils::Table::DataTestable::UniqueCombinationOfColumnsDataTestable

Extended by:
RequiredMethods
Included in:
Table::DataTest
Defined in:
lib/active_record/dbt/dbt_package/dbt_utils/table/data_testable/unique_combination_of_columns_data_testable.rb

Instance Method Summary collapse

Methods included from RequiredMethods

define_required_methods

Instance Method Details

#unique_combination_of_columns_testObject



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/active_record/dbt/dbt_package/dbt_utils/table/data_testable/unique_combination_of_columns_data_testable.rb', line 16

def unique_combination_of_columns_test
  return nil unless used_dbt_utils?

  indexes.each_with_object([]) do |index, array|
    next if unique_indexes?(index)

    array.push(
      {
        'dbt_utils.unique_combination_of_columns' => {
          'combination_of_columns' => index.columns
        }
      }
    )
  end.presence
end