Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Change migration template name so that it can be easily used in tests

  • Loading branch information...
commit 90be6a1514b186da00b316f2f80a3ed9d7aa1795 1 parent bae4321
@obrie obrie authored
View
2  generators/preferences/preferences_generator.rb
@@ -1,7 +1,7 @@
class PreferencesGenerator < Rails::Generator::Base
def manifest
record do |m|
- m.migration_template 'migration.rb', 'db/migrate', :migration_file_name => 'create_preferences'
+ m.migration_template '001_create_preferences.rb', 'db/migrate', :migration_file_name => 'create_preferences'
end
end
end
View
0  ...rators/preferences/templates/migration.rb → ...ences/templates/001_create_preferences.rb
File renamed without changes
View
4 test/app_root/db/migrate/004_migrate_preferences_to_version_1.rb
@@ -1,12 +1,12 @@
class MigratePreferencesToVersion1 < ActiveRecord::Migration
def self.up
- ActiveRecord::Migrator.new(:up, "#{Rails.root}/../../db/migrate", 0).migrations.each do |migration|
+ ActiveRecord::Migrator.new(:up, "#{Rails.root}/../../generators/preferences/templates", 0).migrations.each do |migration|
migration.migrate(:up)
end
end
def self.down
- ActiveRecord::Migrator.new(:up, "#{Rails.root}/../../db/migrate", 0).migrations.each do |migration|
+ ActiveRecord::Migrator.new(:up, "#{Rails.root}/../../generators/preferences/templates", 0).migrations.each do |migration|
migration.migrate(:down)
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.