Class: CreateActiveMailerTables

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/active_mailer/install/templates/migration.rb

Class Method Summary collapse

Class Method Details

.downObject



16
17
18
19
# File 'lib/generators/active_mailer/install/templates/migration.rb', line 16

def self.down
  drop_table :email_users
  drop_table :email_user_associations
end

.upObject



2
3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/generators/active_mailer/install/templates/migration.rb', line 2

def self.up
  create_table :email_users do |t|
    t.string :email_address
    t.timestamps
  end

  create_table :email_user_associations do |t|
    t.references :email_user
    t.string :emailable_type
    t.integer :emailable_id
    t.timestamps
  end
end