class Cardio::Migration::Transform

for migrations involving data transformations (but not schema changes)

Private Instance Methods

contentedly() { || ... } click to toggle source
# File lib/cardio/migration/transform.rb, line 33
def contentedly
  return yield if ENV["NO_CARD_LOAD"]
  Card::Cache.reset_all
  Card::Auth.as_bot do
    yield
  ensure
    ::Card::Cache.reset_all
  end
end
exec_migration(conn, direction) click to toggle source

Execute this migration in the named direction override ActiveRecord to wrap ‘up’ in ‘contentedly’

Calls superclass method
# File lib/cardio/migration/transform.rb, line 24
def exec_migration conn, direction
  return super if respond_to? :change

  @connection = conn
  contentedly { send direction }
ensure
  @connection = nil
end
with_migration_table() { || ... } click to toggle source
# File lib/cardio/migration/transform.rb, line 15
def with_migration_table
  self.table_name = "transform_migrations"
  yield
ensure
  self.table_name = "schema_migrations"
end