Class: ActiveRecord::ConnectionAdapters::PostgreSQL::Branched::Shadow
- Inherits:
-
Object
- Object
- ActiveRecord::ConnectionAdapters::PostgreSQL::Branched::Shadow
- Defined in:
- lib/active_record/connection_adapters/postgresql/branched/shadow.rb
Instance Method Summary collapse
- #call(table_name) ⇒ Object
-
#initialize(connection, branch_schema) ⇒ Shadow
constructor
A new instance of Shadow.
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 |