Class: ActiveRecord::ConnectionAdapters::PostgreSQL::Branched::Shadow

Inherits:
Object
  • Object
show all
Defined in:
lib/active_record/connection_adapters/postgresql/branched/shadow.rb

Instance Method Summary collapse

Constructor Details

#initialize(connection, branch_schema) ⇒ Shadow

Returns a new instance of Shadow.



6
7
8
9
# File 'lib/active_record/connection_adapters/postgresql/branched/shadow.rb', line 6

def initialize(connection, branch_schema)
  @connection = connection
  @branch_schema = branch_schema
end

Instance Method Details

#call(table_name) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/active_record/connection_adapters/postgresql/branched/shadow.rb', line 11

def call(table_name)
  table = table_name.to_s
  return unless exists_in_public?(table)
  return if already_shadowed?(table)

  create_shadow(table)
end