module Cell::Ext::Migration::MetadataIntercept
This module intercepts create_table
and drop_table
, and updates the list of global tables in ::ActiveRecord::InternalMetadata.
Public Instance Methods
create_table(name, *args, &block)
click to toggle source
Calls superclass method
# File lib/cell/ext/migration.rb, line 79 def create_table(name, *args, &block) super.tap do Meta.add_global_table(name) if pass_context == :global end end
drop_table(name, *args, &block)
click to toggle source
Calls superclass method
# File lib/cell/ext/migration.rb, line 85 def drop_table(name, *args, &block) super.tap do Meta.remove_global_table(name) if pass_context == :global end end