Module: SchemaMonkey::CoreExtensions::ActiveRecord::Migration::CommandRecorder
- Defined in:
- lib/schema_monkey/core_extensions/active_record/migration/command_recorder.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(base) ⇒ Object
5 6 7 8 9 |
# File 'lib/schema_monkey/core_extensions/active_record/migration/command_recorder.rb', line 5 def self.included(base) base.class_eval do alias_method_chain :add_column, :schema_monkey end end |
Instance Method Details
#add_column_with_schema_monkey(table_name, column_name, type, options = {}) ⇒ Object
11 12 13 14 15 |
# File 'lib/schema_monkey/core_extensions/active_record/migration/command_recorder.rb', line 11 def add_column_with_schema_monkey(table_name, column_name, type, = {}) SchemaMonkey::Middleware::Migration::Column.start(caller: self, operation: :record, table_name: table_name, column_name: column_name, type: type, options: .deep_dup) do |env| add_column_without_schema_monkey env.table_name, env.column_name, env.type, env. end end |