Module: ActiveRecordShards::DefaultReplicaPatches::SchemaDefinePatch

Defined in:
lib/active_record_shards/default_replica_patches.rb

Instance Method Summary collapse

Instance Method Details

#define(info, &block) ⇒ Object



228
229
230
231
232
233
234
# File 'lib/active_record_shards/default_replica_patches.rb', line 228

def define(info, &block)
  old_val = Thread.current[:_active_record_shards_in_migration]
  Thread.current[:_active_record_shards_in_migration] = true
  super
ensure
  Thread.current[:_active_record_shards_in_migration] = old_val
end