Module: TimeRangeUniqueness::MigrationAdditions::CommandRecorder

Defined in:
lib/time_range_uniqueness/migration_additions.rb

Overview

This module extends the ActiveRecord::Migration::CommandRecorder to record the custom add_time_range_uniqueness command so that it can be replayed during rollback operations.

Instance Method Summary collapse

Instance Method Details

#add_time_range_uniqueness(table, options = {}) ⇒ Object

Records the add_time_range_uniqueness command.

Parameters:

  • The name of the table.

  • (defaults to: {})

    The options for the constraint.



155
156
157
158
# File 'lib/time_range_uniqueness/migration_additions.rb', line 155

def add_time_range_uniqueness(table, options = {})
  # Record the command so it can be replayed during rollback
  record(:add_time_range_uniqueness, table, options)
end