Class: CreateInvalidRecords

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/active_sanity/templates/create_invalid_records.rb

Class Method Summary collapse

Class Method Details

.downObject



11
12
13
# File 'lib/generators/active_sanity/templates/create_invalid_records.rb', line 11

def self.down
  drop_table :invalid_records
end

.upObject



2
3
4
5
6
7
8
9
# File 'lib/generators/active_sanity/templates/create_invalid_records.rb', line 2

def self.up
  create_table :invalid_records do |t|
    t.references :record, :polymorphic => true, :null => false
    t.text :validation_errors
    t.timestamps
  end
  add_index :invalid_records, [:record_type, :record_id]
end