Module: ActiveRecord::ConnectionAdapters::PostgreSQL::Branched

Defined in:
lib/active_record/connection_adapters/postgresql/branched/shadow.rb,
lib/active_record/connection_adapters/postgresql/branched/adapter.rb,
lib/active_record/connection_adapters/postgresql/branched/railtie.rb,
lib/active_record/connection_adapters/postgresql/branched/schema_dumper.rb,
lib/active_record/connection_adapters/postgresql/branched/branch_manager.rb

Defined Under Namespace

Modules: SchemaDumperExtension Classes: Adapter, BranchManager, Railtie, Shadow

Class Method Summary collapse

Class Method Details

.table_methodsObject

All SchemaStatements methods whose first parameter name contains “table” — covers table_name, from_table, table_1, table_names, and any future variant.



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/active_record/connection_adapters/postgresql/branched/adapter.rb', line 8

def self.table_methods
  [
    ActiveRecord::ConnectionAdapters::SchemaStatements,
    ActiveRecord::ConnectionAdapters::PostgreSQL::SchemaStatements
  ].flat_map { |mod|
    mod.instance_methods(false).select { |m|
      first_param = mod.instance_method(m).parameters.first
      first_param && first_param.last.to_s.include?("table")
    }
  }.uniq
end