What you're trying to do won't work at all.
When a migration is run, Rails runs the up class method. Having a new migration inherit another migration's up method will try to create the same table twice. This will cause the migration to fail.
Not that it matters any way. Due to the way that migrations work Rails will only run the class that shares its name with the file that contains it.
It looks like you're trying to do one of two similar things here.
The models suggest Single Table Inheritance. STI requires a string column named type and all subclasses will use the table of the parent model, in this case letters. You only need to define one table, and Rails takes care of all the type column mysteries when declare one model to be a subclass of another.
You're trying to define multiple similar tables and then tweak the differences. This can be done with loops and conditions in a single migration. However you will need to need to define the table_name in any of the models that are inheriting from others to disable the implied Single Table Inheritance. Your migration loop would like something like this:
class CreateLetter < ActiveRecord::Migration
def self.up
[:letters, :a, :b].each do |table_name|
create_table table_name do |t|
...
t.timestamps
if table_name == :a
# columns only in table a
end
if table_name == :b
# columns only in table b
end
end
end
end