Skip to content

Commit aa5695f

Browse files
authored
Merge pull request #73 from github/mgriffin/template
Rename template file to have .tt extension
2 parents c64a5e8 + 4864889 commit aa5695f

3 files changed

Lines changed: 3 additions & 7 deletions

File tree

‎lib/generators/github/ds/active_record_generator.rb‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class ActiveRecordGenerator < ::Rails::Generators::Base
1010
source_paths << File.join(File.dirname(__FILE__), "templates")
1111

1212
def create_migration_file
13-
migration_template "migration.rb", "db/migrate/create_key_values_table.rb", migration_version: migration_version
13+
migration_template "migration.rb.tt", "db/migrate/create_key_values_table.rb", migration_version: migration_version
1414
end
1515

1616
def self.next_migration_number(dirname)

lib/generators/github/ds/templates/migration.rb renamed to lib/generators/github/ds/templates/migration.rb.tt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,9 @@ def self.up
99

1010
add_index <%= table_name %>, :key, :unique => true
1111
add_index <%= table_name %>, :expires_at
12-
13-
change_column <%= table_name %>, :id, "bigint(20) NOT NULL AUTO_INCREMENT"
1412
end
1513

1614
def self.down
17-
drop_table <%= table_name %>
15+
drop_table <%= table_name %>
1816
end
1917
end

‎test/generators/github/store/active_record_generator_test.rb‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,10 @@ def self.up
2929
3030
add_index :#{table_name}, :key, :unique => true
3131
add_index :#{table_name}, :expires_at
32-
33-
change_column :#{table_name}, :id, "bigint(20) NOT NULL AUTO_INCREMENT"
3432
end
3533
3634
def self.down
37-
drop_table :#{table_name}
35+
drop_table :#{table_name}
3836
end
3937
end
4038
EOM

0 commit comments

Comments
 (0)